Top Description Inners Fields Constructors Methods
javax.security.auth.message.callback

public Class PrivateKeyCallback

extends Object
implements Callback
Class Inheritance
All Implemented Interfaces
javax.security.auth.callback.Callback
Imports
java.math.BigInteger, java.security.PrivateKey, java.security.cert.Certificate, javax.security.auth.callback.Callback, javax.security.auth.x500.X500Principal

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 and Inner Type Summary

Modifier and TypeClass and Description
public static class
PrivateKeyCallback.AliasRequest

Request type for private keys that are identified using an alias.

public static class
PrivateKeyCallback.DigestRequest

Request type for private keys that are identified using a certificate digest or thumbprint.

public static class
PrivateKeyCallback.IssuerSerialNumRequest

Request type for private keys that are identified using an issuer/serial number.

public static interface
PrivateKeyCallback.Request

Marker interface for private key request types.

public static class
PrivateKeyCallback.SubjectKeyIDRequest

Request type for private keys that are identified using a SubjectKeyID

Field Summary

Modifier and TypeField and Description
private Certificate[]
private PrivateKey
private PrivateKeyCallback.Request

Constructor Summary

AccessConstructor and Description
public
PrivateKeyCallback(PrivateKeyCallback.Request
Identifier for the private key, or null.
request
)

Constructs this PrivateKeyCallback with a private key Request object.

Method Summary

Modifier and TypeMethod and Description
public Certificate[]

Returns:

The certificate chain, or null if the chain could not be found.
getChain
()

Used to obtain the certicicate chain set within the Callback.

public PrivateKey

Returns:

The private key, or null if the key could not be found.
getKey
()

Used to obtain the private key set within the Callback.

public PrivateKeyCallback.Request

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.
getRequest
()

Used by the CallbackHandler to get the Request object that identifies the private key to be returned.

public void
setKey(PrivateKey
The private key, or null.
key
,
Certificate[]
The corresponding certificate chain, or null.
chain
)

Used by the CallbackHandler to set the requested private key and the corresponding certificate chain within the Callback.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

chainback to summary
private Certificate[] chain
keyback to summary
private PrivateKey key
requestback to summary
private PrivateKeyCallback.Request request

Constructor Detail

PrivateKeyCallbackback to summary
public 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:PrivateKeyCallback.Request

Identifier for the private key, or null.

Method Detail

getChainback to summary
public Certificate[] getChain()

Used to obtain the certicicate chain set within the Callback.

Returns:Certificate[]

The certificate chain, or null if the chain could not be found.

getKeyback to summary
public PrivateKey getKey()

Used to obtain the private key set within the Callback.

Returns:PrivateKey

The private key, or null if the key could not be found.

getRequestback to summary
public PrivateKeyCallback.Request getRequest()

Used by the CallbackHandler to get the Request object that identifies the private key to be returned.

Returns:PrivateKeyCallback.Request

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.

setKeyback to summary
public 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:PrivateKey

The private key, or null.

chain:Certificate[]

The corresponding certificate chain, or null.

javax.security.auth.message.callback back to summary

public Class PrivateKeyCallback.AliasRequest

extends Object
implements Request
Class Inheritance
  • java.lang.Object
  • javax.security.auth.message.callback.PrivateKeyCallback.AliasRequest
All Implemented Interfaces
javax.security.auth.message.callback.PrivateKeyCallback.Request

Request type for private keys that are identified using an alias.

Field Summary

Modifier and TypeField and Description
private String

Constructor Summary

AccessConstructor and Description
public
AliasRequest(String
Name identifier for the private key, or null.
alias
)

Construct an AliasRequest with an alias.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The alias, or null.
getAlias
()

Get the alias.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

aliasback to summary
private String alias

Constructor Detail

AliasRequestback to summary
public AliasRequest(String alias)

Construct an AliasRequest with an alias.

The alias is used to directly identify the private key to be returned. The corresponding certificate chain for the private key is also returned.

If the alias is null, the handler of the callback relies on its own default.

Parameters
alias:String

Name identifier for the private key, or null.

Method Detail

getAliasback to summary
public String getAlias()

Get the alias.

Returns:String

The alias, or null.

javax.security.auth.message.callback back to summary

public Class PrivateKeyCallback.DigestRequest

extends Object
implements Request
Class Inheritance
  • java.lang.Object
  • javax.security.auth.message.callback.PrivateKeyCallback.DigestRequest
All Implemented Interfaces
javax.security.auth.message.callback.PrivateKeyCallback.Request

Request type for private keys that are identified using a certificate digest or thumbprint.

Field Summary

Modifier and TypeField and Description
private String
private byte[]

Constructor Summary

AccessConstructor and Description
public
DigestRequest(byte[]
The digest value to use to select the corresponding certificate and private key (or null).
digest
,
String
A string value identifying the digest algorithm. The value passed to this parameter may be null. If it is not null, it must conform to the requirements for the algorithm parameter of java.security.MessageDigest.getInstance().
algorithm
)

Constructs a DigestRequest with a digest value and algorithm identifier.

Method Summary

Modifier and TypeMethod and Description
public String

Returns:

The identifer of the algorithm used to compute the digest.
getAlgorithm
()

Get the algorithm identifier.

public byte[]

Returns:

The digest value which must match the digest of the certificate corresponding to the returned private key.
getDigest
()

Get the digest value.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

algorithmback to summary
private String algorithm
digestback to summary
private byte[] digest

Constructor Detail

DigestRequestback to summary
public DigestRequest(byte[] digest, String algorithm)

Constructs a DigestRequest with a digest value and algorithm identifier.

The digest of the certificate whose private key is returned must match the provided digest. The certificate digest is computed by applying the specified algorithm to the bytes of the certificate. For example: MessageDigest.getInstance(algorithm).digest(cert.getEncoded()) . The corresponding certificate chain for the private key is also returned. If the digest or algorithm parameters are null, the handler of the callback relies on its own defaults.

Parameters
digest:byte[]

The digest value to use to select the corresponding certificate and private key (or null).

algorithm:String

A string value identifying the digest algorithm. The value passed to this parameter may be null. If it is not null, it must conform to the requirements for the algorithm parameter of java.security.MessageDigest.getInstance().

Method Detail

getAlgorithmback to summary
public String getAlgorithm()

Get the algorithm identifier.

Returns:String

The identifer of the algorithm used to compute the digest.

getDigestback to summary
public byte[] getDigest()

Get the digest value.

Returns:byte[]

The digest value which must match the digest of the certificate corresponding to the returned private key.

javax.security.auth.message.callback back to summary

public Class PrivateKeyCallback.IssuerSerialNumRequest

extends Object
implements Request
Class Inheritance
  • java.lang.Object
  • javax.security.auth.message.callback.PrivateKeyCallback.IssuerSerialNumRequest
All Implemented Interfaces
javax.security.auth.message.callback.PrivateKeyCallback.Request

Request type for private keys that are identified using an issuer/serial number.

Field Summary

Modifier and TypeField and Description
private X500Principal
private BigInteger

Constructor Summary

AccessConstructor and Description
public
IssuerSerialNumRequest(X500Principal
The X500Principal name of the certificate issuer, or null.
issuer
,
BigInteger
The serial number of the certificate, or null.
serialNumber
)

Constructs a IssuerSerialNumRequest with an issuer/serial number.

Method Summary

Modifier and TypeMethod and Description
public X500Principal

Returns:

The issuer, or null.
getIssuer
()

Get the issuer.

public BigInteger

Returns:

The serial number, or null.
getSerialNum
()

Get the serial number.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

issuerback to summary
private X500Principal issuer
serialNumback to summary
private BigInteger serialNum

Constructor Detail

IssuerSerialNumRequestback to summary
public IssuerSerialNumRequest(X500Principal issuer, BigInteger serialNumber)

Constructs a IssuerSerialNumRequest with an issuer/serial number.

The issuer/serial number is used to identify a public key certificate. The corresponding private key is returned in the callback. The corresponding certificate chain for the private key is also returned. If the issuer/serialNumber parameters are null, the handler of the callback relies on its own defaults.

Parameters
issuer:X500Principal

The X500Principal name of the certificate issuer, or null.

serialNumber:BigInteger

The serial number of the certificate, or null.

Method Detail

getIssuerback to summary
public X500Principal getIssuer()

Get the issuer.

Returns:X500Principal

The issuer, or null.

getSerialNumback to summary
public BigInteger getSerialNum()

Get the serial number.

Returns:BigInteger

The serial number, or null.

javax.security.auth.message.callback back to summary

public Interface PrivateKeyCallback.Request

Known Direct Implementers
javax.security.auth.message.callback.PrivateKeyCallback.AliasRequest, javax.security.auth.message.callback.PrivateKeyCallback.SubjectKeyIDRequest, javax.security.auth.message.callback.PrivateKeyCallback.IssuerSerialNumRequest, javax.security.auth.message.callback.PrivateKeyCallback.DigestRequest

Marker interface for private key request types.
javax.security.auth.message.callback back to summary

public Class PrivateKeyCallback.SubjectKeyIDRequest

extends Object
implements Request
Class Inheritance
  • java.lang.Object
  • javax.security.auth.message.callback.PrivateKeyCallback.SubjectKeyIDRequest
All Implemented Interfaces
javax.security.auth.message.callback.PrivateKeyCallback.Request

Request type for private keys that are identified using a SubjectKeyID

Field Summary

Modifier and TypeField and Description
private byte[]

Constructor Summary

AccessConstructor and Description
public
SubjectKeyIDRequest(byte[]
Identifier for the private key, or null.
subjectKeyID
)

Construct a SubjectKeyIDRequest with an subjectKeyID.

Method Summary

Modifier and TypeMethod and Description
public byte[]

Returns:

The subjectKeyID, or null.
getSubjectKeyID
()

Get the subjectKeyID.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

idback to summary
private byte[] id

Constructor Detail

SubjectKeyIDRequestback to summary
public SubjectKeyIDRequest(byte[] subjectKeyID)

Construct a SubjectKeyIDRequest with an subjectKeyID.

The subjectKeyID is used to directly identify the private key to be returned. The corresponding certificate chain for the private key is also returned.

If the subjectKeyID is null, the handler of the callback relies on its own default.

Parameters
subjectKeyID:byte[]

Identifier for the private key, or null.

Method Detail

getSubjectKeyIDback to summary
public byte[] getSubjectKeyID()

Get the subjectKeyID.

Returns:byte[]

The subjectKeyID, or null.