public abstract class ECDH1PUCryptoProvider extends Object
JWE
objects
.
Supports the following key management algorithms:
JWEAlgorithm.ECDH_1PU
JWEAlgorithm.ECDH_1PU_A128KW
JWEAlgorithm.ECDH_1PU_A192KW
JWEAlgorithm.ECDH_1PU_A256KW
Supports the following elliptic curves:
Supports the following content encryption algorithms for Direct key agreement mode:
EncryptionMethod.A128CBC_HS256
EncryptionMethod.A192CBC_HS384
EncryptionMethod.A256CBC_HS512
EncryptionMethod.A128GCM
EncryptionMethod.A192GCM
EncryptionMethod.A256GCM
EncryptionMethod.A128CBC_HS256_DEPRECATED
EncryptionMethod.A256CBC_HS512_DEPRECATED
EncryptionMethod.XC20P
Supports the following content encryption algorithms for Key wrapping mode:
Modifier and Type | Field and Description |
---|---|
static Set<JWEAlgorithm> |
SUPPORTED_ALGORITHMS
The supported JWE algorithms by the ECDH crypto provider class.
|
static Set<EncryptionMethod> |
SUPPORTED_ENCRYPTION_METHODS
The supported encryption methods by the ECDH crypto provider class.
|
Modifier | Constructor and Description |
---|---|
protected |
ECDH1PUCryptoProvider(Curve curve)
Creates a new Elliptic Curve Diffie-Hellman One-Pass Unified Model
encryption / decryption provider.
|
Modifier and Type | Method and Description |
---|---|
protected byte[] |
decryptWithZ(JWEHeader header,
SecretKey Z,
Base64URL encryptedKey,
Base64URL iv,
Base64URL cipherText,
Base64URL authTag)
Decrypts the encrypted JWE parts using the specified shared secret ("Z").
|
protected JWECryptoParts |
encryptWithZ(JWEHeader header,
SecretKey Z,
byte[] clearText,
SecretKey contentEncryptionKey)
Encrypts the specified plaintext using the specified shared secret
("Z"), with an optionally externally supplied content encryption key
(CEK) for
ECDH.AlgorithmMode.KW . |
protected ConcatKDF |
getConcatKDF()
Returns the Concatenation Key Derivation Function (KDF).
|
Curve |
getCurve()
Returns the elliptic curve of the key (JWK designation).
|
JWEJCAContext |
getJCAContext()
Returns the Java Cryptography Architecture (JCA) context.
|
abstract Set<Curve> |
supportedEllipticCurves()
Returns the names of the supported elliptic curves.
|
Set<EncryptionMethod> |
supportedEncryptionMethods()
Returns the names of the supported encryption methods by the JWE
provier.
|
Set<JWEAlgorithm> |
supportedJWEAlgorithms()
Returns the names of the supported algorithms by the JWE provider
instance.
|
public static final Set<JWEAlgorithm> SUPPORTED_ALGORITHMS
public static final Set<EncryptionMethod> SUPPORTED_ENCRYPTION_METHODS
protected ECDH1PUCryptoProvider(Curve curve) throws JOSEException
curve
- The elliptic curve. Must be supported and not
null
.JOSEException
- If the elliptic curve is not supported.protected ConcatKDF getConcatKDF()
public abstract Set<Curve> supportedEllipticCurves()
crv
JWK parameter.public Curve getCurve()
protected JWECryptoParts encryptWithZ(JWEHeader header, SecretKey Z, byte[] clearText, SecretKey contentEncryptionKey) throws JOSEException
ECDH.AlgorithmMode.KW
.JOSEException
protected byte[] decryptWithZ(JWEHeader header, SecretKey Z, Base64URL encryptedKey, Base64URL iv, Base64URL cipherText, Base64URL authTag) throws JOSEException
JOSEException
public Set<JWEAlgorithm> supportedJWEAlgorithms()
JWEProvider
alg
JWE header parameter.supportedJWEAlgorithms
in interface JWEProvider
public Set<EncryptionMethod> supportedEncryptionMethods()
JWEProvider
enc
JWE header parameter.supportedEncryptionMethods
in interface JWEProvider
public JWEJCAContext getJCAContext()
JCAAware
getJCAContext
in interface JCAAware<JWEJCAContext>
null
.Copyright © 2021 Connect2id Ltd.. All rights reserved.