Class PrivateKeyCallback
java.lang.Object
jakarta.security.auth.message.callback.PrivateKeyCallback
- All Implemented Interfaces:
Callback
A callback that enables an authentication module to request a
certificate chain and private key from the runtime. The request
identifies the desired key material using one of several
PrivateKeyCallback.Request
subtypes, such as keystore alias, certificate digest, subject key
identifier, or issuer and serial number.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classA request to retrieve a certificate chain and private key by keystore alias.static classA request to retrieve a certificate chain and private key by certificate digest value.static classA request to retrieve a certificate chain and private key by the issuer distinguished name and certificate serial number.static interfaceBase interface for private key requests.static classA request to retrieve a certificate chain and private key by the Subject Key Identifier extension value. -
Constructor Summary
ConstructorsConstructorDescriptionCreates a newPrivateKeyCallbackwith the specified request. -
Method Summary
Modifier and TypeMethodDescriptiongetChain()Returns the certificate chain resolved by the runtime.getKey()Returns the private key resolved by the runtime.Returns the request associated with this callback.voidsetKey(PrivateKey key, Certificate[] chain) Sets the private key and certificate chain resolved by the runtime in response to the request.
-
Constructor Details
-
PrivateKeyCallback
Creates a newPrivateKeyCallbackwith the specified request.- Parameters:
request- theRequestobject identifying the desired certificate chain and private key
-
-
Method Details
-
getRequest
Returns the request associated with this callback.- Returns:
- the
Requestobject
-
setKey
Sets the private key and certificate chain resolved by the runtime in response to the request.- Parameters:
key- the resolvedPrivateKeychain- the corresponding certificate chain
-
getKey
Returns the private key resolved by the runtime.- Returns:
- the
PrivateKey, ornullif not yet resolved
-
getChain
Returns the certificate chain resolved by the runtime.- Returns:
- the certificate chain, or
nullif not yet resolved
-