Package com.nimbusds.jose.crypto.impl
Class ECDH
java.lang.Object
com.nimbusds.jose.crypto.impl.ECDH
Elliptic Curve Diffie-Hellman key agreement functions and utilities.
- Version:
- 2018-12-12
- Author:
- Vladimir Dzhuvinov
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enumeration of the Elliptic Curve Diffie-Hellman Ephemeral Static algorithm modes. -
Method Summary
Modifier and TypeMethodDescriptionstatic SecretKey
deriveSharedKey
(JWEHeader header, SecretKey Z, ConcatKDF concatKDF) Derives a shared key (via concat KDF).static SecretKey
deriveSharedSecret
(OctetKeyPair publicKey, OctetKeyPair privateKey) Derives a shared secret (also called 'Z') from the specified ECDH key agreement.static SecretKey
deriveSharedSecret
(ECPublicKey publicKey, PrivateKey privateKey, Provider provider) Derives a shared secret (also called 'Z') from the specified ECDH key agreement.static ECDH.AlgorithmMode
Resolves the ECDH algorithm mode.static int
sharedKeyLength
(JWEAlgorithm alg, EncryptionMethod enc) Returns the bit length of the shared key (derived via concat KDF) for the specified JWE ECDH algorithm.
-
Method Details
-
resolveAlgorithmMode
Resolves the ECDH algorithm mode.- Parameters:
alg
- The JWE algorithm. Must be supported and notnull
.- Returns:
- The algorithm mode.
- Throws:
JOSEException
- If the JWE algorithm is not supported.
-