Class SecretKeyCallback
- java.lang.Object
-
- jakarta.security.auth.message.callback.SecretKeyCallback
-
- All Implemented Interfaces:
Callback
public class SecretKeyCallback extends Object implements Callback
Callback for acquiring a shared secret from a key repository.This Callback may be used by client or server authentication modules to obtain shared secrets (for example, passwords) without relying on a user during the Callback processing. This Callback is typically called by
ClientAuthModulesinvoked from intermediate components that need to acquire a password to authenticate to their target service.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classSecretKeyCallback.AliasRequestRequest type for secret keys that are identified using an alias.static interfaceSecretKeyCallback.RequestMarker interface for secret key request types.
-
Constructor Summary
Constructors Constructor Description SecretKeyCallback(SecretKeyCallback.Request request)Constructs this SecretKeyCallback with a secret key Request object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SecretKeygetKey()Used to obtain the secret key set within the Callback.SecretKeyCallback.RequestgetRequest()Used by the CallbackHandler to get the Request object which identifies the secret key to be returned.voidsetKey(SecretKey key)Used by the CallbackHandler to set the requested secret key within the Callback.
-
-
-
Constructor Detail
-
SecretKeyCallback
public SecretKeyCallback(SecretKeyCallback.Request request)
Constructs this SecretKeyCallback with a secret key Request object.The request object identifies the secret key to be returned. If the alias is null, the handler of the callback relies on its own default.
- Parameters:
request- Request object identifying the secret key, or null.
-
-
Method Detail
-
getRequest
public SecretKeyCallback.Request getRequest()
Used by the CallbackHandler to get the Request object which identifies the secret key to be returned.- Returns:
- The Request object which identifies the private key to be returned, or null. If null, the handler of the callback relies on its own default.
-
setKey
public void setKey(SecretKey key)
Used by the CallbackHandler to set the requested secret key within the Callback.- Parameters:
key- The secret key, or null if no key was found.
-
getKey
public SecretKey getKey()
Used to obtain the secret key set within the Callback.- Returns:
- The secret key, or null if no key was found.
-
-