Class DefaultClientSecretCredential
java.lang.Object
net.shibboleth.oidc.security.credential.DefaultClientSecretCredential
- All Implemented Interfaces:
ClientSecretCredential
@ThreadSafe
public class DefaultClientSecretCredential
extends Object
implements ClientSecretCredential
A basic implementation of
ClientSecretCredential.- Since:
- 2.2.0
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultClientSecretCredential(String secret) Constructor.DefaultClientSecretCredential(String secret, String keyName) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet the client_secret as a UTF-8 encoded String.byte[]Get the client_secret as UTF-8 bytes.Create a symmetric encryption key derived from the client_secret and compatible with the key management mode and encryption algorithm specified.Create a MAC singing key from the client_secret.
-
Field Details
-
DEFAULT_SECRET_KEY_NAME
Default client_secret keyname.- See Also:
-
clientSecret
@Nonnull private final byte[] clientSecretThe client_secret. -
secretKeyName
The chosen client_secret keyname.
-
-
Constructor Details
-
DefaultClientSecretCredential
Constructor.- Parameters:
secret- the client_secret
-
DefaultClientSecretCredential
Constructor.- Parameters:
secret- the client_secretkeyName- the keyname to use when creating aJWKCredential
-
-
Method Details
-
getSecret
Get the client_secret as a UTF-8 encoded String.- Specified by:
getSecretin interfaceClientSecretCredential- Returns:
- The client_secret.
-
getSecretAsBytes
Get the client_secret as UTF-8 bytes.- Specified by:
getSecretAsBytesin interfaceClientSecretCredential- Returns:
- the client_secret in bytes
-
toSigningCredential
Create a MAC singing key from the client_secret. The MAC key used is the octets of the UTF-8 representation of the client_secret value.- Specified by:
toSigningCredentialin interfaceClientSecretCredential- Returns:
- a MAC signing key
-
toEncryptionCredential
@Nonnull public JWKCredential toEncryptionCredential(@Nonnull JWEAlgorithm alg, @Nonnull EncryptionMethod enc) throws JOSEException Create a symmetric encryption key derived from the client_secret and compatible with the key management mode and encryption algorithm specified.- Specified by:
toEncryptionCredentialin interfaceClientSecretCredential- Parameters:
alg- the key management modeenc- the encryption algorithm- Returns:
- a JWKCredential compatible with the 'alg' and 'enc' input
- Throws:
JOSEException- if a key can not be derived
-