protected static class AbstractRequestingAuthenticationDetailsProvider.CachingSessionKeySupplier extends Object implements SessionKeySupplier
Helper class to cache the private key as bytes so we don’t have to parse it every time. The key only changes during calls to refresh.
All methods in this class that are called outside of this class should be synchronized.
Modifier | Constructor and Description |
---|---|
protected |
CachingSessionKeySupplier(SessionKeySupplier delegate) |
Modifier and Type | Method and Description |
---|---|
KeyPair |
getKeyPair()
Returns the current RSA key pair.
|
protected byte[] |
getPrivateKeyBytes() |
void |
refreshKeys()
If the auth service-issued security token expires, the federation client will try to
re-generate a new set of keys by calling this method.
|
protected CachingSessionKeySupplier(SessionKeySupplier delegate)
public KeyPair getKeyPair()
SessionKeySupplier
Returns the current RSA key pair.
getKeyPair
in interface SessionKeySupplier
public void refreshKeys()
SessionKeySupplier
If the auth service-issued security token expires, the federation client will try to re-generate a new set of keys by calling this method. The implementer should create a new pair of keys for security reasons.
Refreshing keys should not be a long-running blocking call. You can refresh keys in an async thread and return from this method immediately. When the async process is done refreshing the keys, the client code will automatically pick up the latest set of keys and update the security token accordingly
refreshKeys
in interface SessionKeySupplier
protected byte[] getPrivateKeyBytes()
Copyright © 2016–2024. All rights reserved.