Class JWKCredentialSupport
java.lang.Object
net.shibboleth.oidc.security.credential.JWKCredentialSupport
Provide JWK specific credential support.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final JWKCredentialderiveSymmetricKeyForAlgAndEnc(JWKCredential credential, JWEAlgorithm alg, EncryptionMethod enc) Derive a *new* symmetric key credential suitable for the given 'alg' and 'enc' algorithms.static final SecretKeygenerateSymmetricKey(byte[] clientSecret, JWEAlgorithm alg, EncryptionMethod enc) Generate symmetric key from client_secret using the algorithms supplied.static final SecretKeygenerateSymmetricKey(Secret clientSecret, JWEAlgorithm alg, EncryptionMethod enc) Generate symmetric key from client_secret using the algorithms supplied.
-
Constructor Details
-
JWKCredentialSupport
private JWKCredentialSupport()Constructor.
-
-
Method Details
-
deriveSymmetricKeyForAlgAndEnc
@Nullable public static final JWKCredential deriveSymmetricKeyForAlgAndEnc(@Nullable JWKCredential credential, @Nullable JWEAlgorithm alg, @Nullable EncryptionMethod enc) throws JOSEException Derive a *new* symmetric key credential suitable for the given 'alg' and 'enc' algorithms. The new credential is a copy of the given credential but replacing the keyID and secret. If any of the inputs arenullthennullis returned.- Parameters:
credential- the credential that contains a secret key to derive a new credential fromalg- the key management mode algorithmenc- the content encryption algorithm- Returns:
- a *new* derived credential, or
nullif an error occurs - Throws:
JOSEException- on error deriving the credential
-
generateSymmetricKey
@Nonnull public static final SecretKey generateSymmetricKey(@Nonnull byte[] clientSecret, @Nonnull JWEAlgorithm alg, @Nonnull EncryptionMethod enc) throws JOSEException Generate symmetric key from client_secret using the algorithms supplied.- Parameters:
clientSecret- client secret to derive a key fromalg- the key management mode or key transport algorithmenc- the content encryption algorithm- Returns:
- key derived from client secret.
- Throws:
JOSEException- on error
-
generateSymmetricKey
public static final SecretKey generateSymmetricKey(Secret clientSecret, JWEAlgorithm alg, EncryptionMethod enc) throws JOSEException Generate symmetric key from client_secret using the algorithms supplied.- Parameters:
clientSecret- client secret to derive a key fromalg- the key management mode or key transport algorithmenc- the content encryption algorithm- Returns:
- key derived from client secret.
- Throws:
JOSEException- on error
-