public class JwkSetSecretStore extends Object implements SecretStore<CryptoKey>
JWKSet
. The active key for a given
purpose is chosen as the first JWK in the set that satisfies the requirements of that purpose. Named keys are
determined by "kid" value, while valid keys are found by filtering the JWK Set by purpose. A JWK is considered
valid for a given purpose if its key operations and/or use constraints are compatible with the intended key usage.CLOCK, LEASE_EXPIRY_DURATION
Constructor and Description |
---|
JwkSetSecretStore(JWKSet jwkSet,
Options options)
Creates a secret store directly from the given JWK Set.
|
JwkSetSecretStore(JwksStore jwksStore)
Creates a secret store from a
JwksStore . |
JwkSetSecretStore(JwksStore jwksStore,
Options options)
Creates a secret store from a
JwksStore . |
Modifier and Type | Method and Description |
---|---|
<S extends CryptoKey> |
getActive(Purpose<S> purpose)
Returns the active secret for the given purpose.
|
<S extends CryptoKey> |
getNamed(Purpose<S> purpose,
String name)
Returns the named secret from this store.
|
Class<CryptoKey> |
getStoredType()
The top-level class that this store is capable of storing.
|
<S extends CryptoKey> |
getValid(Purpose<S> purpose)
Returns all valid secrets for the given purpose from this store.
|
void |
refresh()
Indicates that the store should refresh its secrets from the backing storage mechanism.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
retire, revoke, rotate
public JwkSetSecretStore(JWKSet jwkSet, Options options)
jwkSet
- the JWK Set to use for the secret store.options
- configuration options.public JwkSetSecretStore(JwksStore jwksStore)
JwksStore
. The remote JWK Set will be periodically refreshed allowing for
key rotation. It is up to the JWK Set provider to ensure that valid keys remain in the JWK Set for any overlap
period.jwksStore
- the JWK Store to load JWK Sets from.public Class<CryptoKey> getStoredType()
SecretStore
getStoredType
in interface SecretStore<CryptoKey>
CryptoKey
for key-stores, GenericSecret
for password stores, or
Secret
if the store is capable of storing any type of secret.public <S extends CryptoKey> Promise<S,NoSuchSecretException> getActive(Purpose<S> purpose)
SecretStore
getActive
in interface SecretStore<CryptoKey>
S
- the type of secret.purpose
- the purpose for which a secret is required.public <S extends CryptoKey> Promise<S,NoSuchSecretException> getNamed(Purpose<S> purpose, String name)
SecretStore
getNamed
in interface SecretStore<CryptoKey>
S
- the type of secret.purpose
- the secret purpose.name
- the name (stable id) of the secret.Optional.empty()
if no such secret exists.public <S extends CryptoKey> Promise<Stream<S>,NeverThrowsException> getValid(Purpose<S> purpose)
SecretStore
getValid
in interface SecretStore<CryptoKey>
S
- the type of secret.purpose
- the purpose.public void refresh()
SecretStore
refresh
in interface SecretStore<CryptoKey>
Copyright © 2010-2018, ForgeRock All Rights Reserved.