Class RSA_KEMParameters

All Implemented Interfaces:

public class RSA_KEMParameters
extends Object
implements AlgorithmParameters
The parameters required for the hybrid RSA (KEM = Key Encapsulation Mechanism) scheme. An asymmetric RSA key is used to encapsulate a randomly generated AES key which in turn in used to encrypt and decrypt the data.

Since symmetric schemes are much more efficient than asymmetric schemes, this is in general more efficient than encrypting the data directly with the asymmetric key.

If you want to encrypt/decrypt data at rest with no need to exchange the key with other parties, a symmetric encryption scheme like AES can be used.

Alexander Zeier
  • Constructor Details

    • RSA_KEMParameters

      public RSA_KEMParameters​(RSAParameters.Keysize rsaKeysize, AESParameters.Keysize aesKeysize, AESParameters.Mode mode, AESParameters.Padding padding)
      Creates a new RSA_KEMParameters object with the given rsaKeysize, aesKeysize, mode and padding. RSA KEM (Key Encapsulation Mechanism) is an hybrid encryption scheme using the asymmetrical RSA scheme to encrypt a symmetrical key which in turn encrypts the data.
      rsaKeysize - The size of the RSA key. It can be 2048, 3072 or 4096 bit.
      aesKeysize - The size of the AES key. It can be 128, 192 or 256 bit.
      mode - The mode used for the AES encryption.
      padding - The padding used for the AES encryption.
  • Method Details

    • getType

      public AlgorithmParameters.Type getType()
      Description copied from interface: AlgorithmParameters
      Return the type of the cryptographic scheme.
      Specified by:
      getType in interface AlgorithmParameters
      The type of the cryptographic scheme.
    • getRsaKeysize

      public int getRsaKeysize()
      Get the key size of the RSA key.
      The RSA key size.
    • getAesKeysize

      public int getAesKeysize()
      Get the key size of the AES key.
      The AES key size.
    • getMode

      public String getMode()
      Get the mode for the AES scheme.
      The AES mode.
    • getPadding

      public String getPadding()
      Get the padding for the AES scheme.
      The AES padding.