Package iu.crypt

Class JweRecipientBuilder.EncryptedKeyBuilder

All Implemented Interfaces:
WebCertificateReference.Builder<JweRecipientBuilder.EncryptedKeyBuilder>, WebCryptoHeader.Builder<JweRecipientBuilder.EncryptedKeyBuilder>, WebKeyReference.Builder<JweRecipientBuilder.EncryptedKeyBuilder>
Enclosing class:
JweRecipientBuilder

class JweRecipientBuilder.EncryptedKeyBuilder extends JoseBuilder<JweRecipientBuilder.EncryptedKeyBuilder>
Handles ephemeral key-protection parameters.
  • Method Details

    • algorithm

      WebKey.Algorithm algorithm()
      Gets the algorithm
      Returns:
      algorithm
    • agreedUponKey

      byte[] agreedUponKey(WebEncryption.Encryption encryption)
      Computes the agreed-upon key for the Elliptic Curve Diffie-Hellman algorithm.
      Parameters:
      encryption - encryption algorithm
      Returns:
      agreed-upon key
      See Also:
    • passphraseDerivedKey

      byte[] passphraseDerivedKey()
      Gets the passphrase-derived key to use with PBKDF2 key derivation defined by PKCS#5.
      Returns:
      128-bit derived key data suitable for use with AESWrap
    • encrypt

      JweRecipient encrypt(WebEncryption.Encryption encryption, byte[] contentEncryptionKey)
      Generates the encrypted key and creates the recipient.
      Parameters:
      encryption - content encryption algorithm
      contentEncryptionKey - supplies an ephemeral content encryption key if needed
      Returns:
      recipient