- All Implemented Interfaces:
WebCertificateReference.Builder<JweRecipientBuilder>
,WebCryptoHeader.Builder<JweRecipientBuilder>
,WebEncryptionRecipient.Builder<JweRecipientBuilder>
,WebKeyReference.Builder<JweRecipientBuilder>
public class JweRecipientBuilder
extends JoseBuilder<JweRecipientBuilder>
implements WebEncryptionRecipient.Builder<JweRecipientBuilder>
Builds JWE recipients for
JweBuilder
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) class
Handles ephemeral key-protection parameters. -
Constructor Summary
ConstructorsConstructorDescriptionJweRecipientBuilder
(JweBuilder jweBuilder, WebKey.Algorithm algorithm) Constructor -
Method Summary
Modifier and TypeMethodDescription(package private) static byte[]
agreedUponKey
(PrivateKey privateKey, PublicKey publicKey, String algorithm, byte[] algId, byte[] uinfo, byte[] vinfo, int keyDataLen) Computes the agreed-upon key for ECDH key agreement with NIST.SP.800.56C Concat KDF using SHA-256 as the key derivation formula.(package private) JweRecipientBuilder.EncryptedKeyBuilder
Gets a builder for completing key protection.then()
Returns theWebEncryption.Builder
that spawned this builder instance.Methods inherited from class iu.crypt.JoseBuilder
contentType, copy, crit, key, key, param, param, param, type, wellKnown, wellKnown
Methods inherited from class iu.crypt.KeyReferenceBuilder
algorithm, keyId
Methods inherited from class edu.iu.client.IuJsonBuilder
build, param, paramNames, toJson
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface edu.iu.crypt.WebCertificateReference.Builder
cert, cert, pem, pem, x5t, x5t256
Methods inherited from interface edu.iu.crypt.WebCryptoHeader.Builder
contentType, crit, key, keyId, param, param, type, wellKnown, wellKnown
Methods inherited from interface edu.iu.crypt.WebEncryptionRecipient.Builder
encrypt, encrypt, encrypt
-
Constructor Details
-
JweRecipientBuilder
JweRecipientBuilder(JweBuilder jweBuilder, WebKey.Algorithm algorithm) Constructor- Parameters:
jweBuilder
- JWE builderalgorithm
- key encryption algorithm
-
-
Method Details
-
agreedUponKey
static byte[] agreedUponKey(PrivateKey privateKey, PublicKey publicKey, String algorithm, byte[] algId, byte[] uinfo, byte[] vinfo, int keyDataLen) Computes the agreed-upon key for ECDH key agreement with NIST.SP.800.56C Concat KDF using SHA-256 as the key derivation formula.- Parameters:
privateKey
- JCE private keypublicKey
- JCE public keyalgorithm
- JCE key agreement algorithm namealgId
- JWA algorithm IDuinfo
- PartyUInfo value for Concat KDFvinfo
- PartyVInfo value for Concat KDFkeyDataLen
- bit length of desired output key, SuppPubInfo for Concat KDF- Returns:
- derived key data
- See Also:
-
then
Description copied from interface:WebEncryptionRecipient.Builder
Returns theWebEncryption.Builder
that spawned this builder instance.- Specified by:
then
in interfaceWebEncryptionRecipient.Builder<JweRecipientBuilder>
- Returns:
WebEncryption.Builder
-
encryptedKeyBuilder
JweRecipientBuilder.EncryptedKeyBuilder encryptedKeyBuilder()Gets a builder for completing key protection.- Returns:
- encrypted key builder
-