Package net.solarnetwork.web.support
Class StaticAuthorizationCredentialsProvider
java.lang.Object
net.solarnetwork.web.support.StaticAuthorizationCredentialsProvider
- All Implemented Interfaces:
AuthorizationCredentialsProvider
public class StaticAuthorizationCredentialsProvider
extends Object
implements AuthorizationCredentialsProvider
A simple statically assigned authorization credentials provider.
- Since:
- 1.16
- Version:
- 1.1
- Author:
- matt
-
Constructor Summary
ConstructorsConstructorDescriptionStaticAuthorizationCredentialsProvider(String authorizationId, byte[] signingKey, Instant signingDate) Constructor for a signing key.StaticAuthorizationCredentialsProvider(String authorizationId, String authorizationSecret) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionGet the authorization identifier.Get the authorization secret.Get the pre-computed signing key sign date.byte[]Get a pre-computed signing key.
-
Constructor Details
-
StaticAuthorizationCredentialsProvider
Constructor.- Parameters:
authorizationId- the authorization IDauthorizationSecret- the authorization secret
-
StaticAuthorizationCredentialsProvider
public StaticAuthorizationCredentialsProvider(String authorizationId, byte[] signingKey, Instant signingDate) Constructor for a signing key.- Parameters:
authorizationId- the authorization IDsigningKey- the authorization signing keysigningDate- the authorization signing date
-
-
Method Details
-
getAuthorizationId
Description copied from interface:AuthorizationCredentialsProviderGet the authorization identifier.- Specified by:
getAuthorizationIdin interfaceAuthorizationCredentialsProvider- Returns:
- the authorization identifier
-
getAuthorizationSecret
Description copied from interface:AuthorizationCredentialsProviderGet the authorization secret.- Specified by:
getAuthorizationSecretin interfaceAuthorizationCredentialsProvider- Returns:
- the authorization secret
-
getAuthorizationSigningKey
public byte[] getAuthorizationSigningKey()Description copied from interface:AuthorizationCredentialsProviderGet a pre-computed signing key.- Specified by:
getAuthorizationSigningKeyin interfaceAuthorizationCredentialsProvider- Returns:
- the pre-computed signing key, signed using the
AuthorizationCredentialsProvider.getAuthorizationSigningDate()date, or null ifAuthorizationCredentialsProvider.getAuthorizationSecret()should be used - See Also:
-
getAuthorizationSigningDate
Description copied from interface:AuthorizationCredentialsProviderGet the pre-computed signing key sign date.- Specified by:
getAuthorizationSigningDatein interfaceAuthorizationCredentialsProvider- Returns:
- the date used to sign
AuthorizationCredentialsProvider.getAuthorizationSigningKey()if that is non-null
-