RSAKEMGenerator (Bouncy Castle Library 1.85 API Specification)
Date: 2026-07-12

org.bouncycastle.crypto.kems

## Class RSAKEMGenerator

- java.lang.Object
- - org.bouncycastle.crypto.kems.RSAKEMGenerator

- All Implemented Interfaces:
    EncapsulatedSecretGenerator

      public class RSAKEMGenerator
      extends java.lang.Object
      implements EncapsulatedSecretGenerator

  The RSA Key Encapsulation Mechanism (RSA-KEM) from ISO 18033-2.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `RSAKEMGenerator(int keyLen, DerivationFunction kdf, java.security.SecureRandom rnd)` Set up the RSA-KEM.

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `SecretWithEncapsulation` | `generateEncapsulated(AsymmetricKeyParameter recipientKey)` Generate secret/encapsulation based on the recipient public key.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### RSAKEMGenerator

          public RSAKEMGenerator(int keyLen,
                                 DerivationFunction kdf,
                                 java.security.SecureRandom rnd)

      Set up the RSA-KEM.
      Parameters:
        `kdf` - the key derivation function to be used.
        `rnd` - the random source for the session key.

  - ### Method Detail

    - #### generateEncapsulated

          public SecretWithEncapsulation generateEncapsulated(AsymmetricKeyParameter recipientKey)

      Description copied from interface: `EncapsulatedSecretGenerator`
      Generate secret/encapsulation based on the recipient public key.
      Specified by:
        `generateEncapsulated` in interface `EncapsulatedSecretGenerator`
      Returns:
        An SecretWithEncapsulation derived from the recipient public key.