Class PrivateKeyCallback

java.lang.Object
jakarta.security.auth.message.callback.PrivateKeyCallback
All Implemented Interfaces:
Callback

public class PrivateKeyCallback extends Object implements 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.
  • Constructor Details

    • PrivateKeyCallback

      public PrivateKeyCallback(PrivateKeyCallback.Request request)
      Creates a new PrivateKeyCallback with the specified request.
      Parameters:
      request - the Request object identifying the desired certificate chain and private key
  • Method Details

    • getRequest

      public PrivateKeyCallback.Request getRequest()
      Returns the request associated with this callback.
      Returns:
      the Request object
    • setKey

      public void setKey(PrivateKey key, Certificate[] chain)
      Sets the private key and certificate chain resolved by the runtime in response to the request.
      Parameters:
      key - the resolved PrivateKey
      chain - the corresponding certificate chain
    • getKey

      public PrivateKey getKey()
      Returns the private key resolved by the runtime.
      Returns:
      the PrivateKey, or null if not yet resolved
    • getChain

      public Certificate[] getChain()
      Returns the certificate chain resolved by the runtime.
      Returns:
      the certificate chain, or null if not yet resolved