Class PrivateKeyCallback
- java.lang.Object
- 
- jakarta.security.auth.message.callback.PrivateKeyCallback
 
- 
- All Implemented Interfaces:
- Callback
 
 public class PrivateKeyCallback extends Object implements Callback Callback for acquiring a Public Key Infrastructure (PKI) private key and its corresponding certificate chain.This Callback may be used by client or server authentication modules to obtain private keys or private key references, from key repositories available to the CallbackHandler that processes the Callback. 
- 
- 
Nested Class SummaryNested Classes Modifier and Type Class Description static classPrivateKeyCallback.AliasRequestRequest type for private keys that are identified using an alias.static classPrivateKeyCallback.DigestRequestRequest type for private keys that are identified using a certificate digest or thumbprint.static classPrivateKeyCallback.IssuerSerialNumRequestRequest type for private keys that are identified using an issuer/serial number.static interfacePrivateKeyCallback.RequestMarker interface for private key request types.static classPrivateKeyCallback.SubjectKeyIDRequestRequest type for private keys that are identified using a SubjectKeyID
 - 
Constructor SummaryConstructors Constructor Description PrivateKeyCallback(PrivateKeyCallback.Request request)Constructs this PrivateKeyCallback with a private key Request object.
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description Certificate[]getChain()Used to obtain the certificate chain set within the Callback.PrivateKeygetKey()Used to obtain the private key set within the Callback.PrivateKeyCallback.RequestgetRequest()Used by the CallbackHandler to get the Request object that identifies the private key to be returned.voidsetKey(PrivateKey key, Certificate[] chain)Used by the CallbackHandler to set the requested private key and the corresponding certificate chain within the Callback.
 
- 
- 
- 
Constructor Detail- 
PrivateKeyCallbackpublic PrivateKeyCallback(PrivateKeyCallback.Request request) Constructs this PrivateKeyCallback with a private key Request object.The request object identifies the private key to be returned. The corresponding certificate chain for the private key is also returned. If the request object is null, the handler of the callback relies on its own default. - Parameters:
- request- Identifier for the private key, or null.
 
 
- 
 - 
Method Detail- 
getRequestpublic PrivateKeyCallback.Request getRequest() Used by the CallbackHandler to get the Request object that identifies the private 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.
 
 - 
setKeypublic void setKey(PrivateKey key, Certificate[] chain) Used by the CallbackHandler to set the requested private key and the corresponding certificate chain within the Callback.If the requested private key or chain could not be found, then both values must be set to null. - Parameters:
- key- The private key, or null.
- chain- The corresponding certificate chain, or null.
 
 - 
getKeypublic PrivateKey getKey() Used to obtain the private key set within the Callback.- Returns:
- The private key, or null if the key could not be found.
 
 - 
getChainpublic Certificate[] getChain() Used to obtain the certificate chain set within the Callback.- Returns:
- The certificate chain, or null if the chain could not be found.
 
 
- 
 
-