FileDocCategorySizeDatePackage
PrivateKeyCallback.javaAPI DocGlassfish v2 API9311Fri May 04 22:36:10 BST 2007javax.security.auth.message.callback

PrivateKeyCallback

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.
version
%I%, %G%

Fields Summary
private Request
request
private PrivateKey
key
private Certificate[]
chain
Constructors Summary
public 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.

param
request Identifier for the private key, or null.

	this.request = request;
    
Methods Summary
public java.security.cert.Certificate[]getChain()
Used to obtain the certicicate chain set within the Callback.

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

	return chain;
    
public java.security.PrivateKeygetKey()
Used to obtain the private key set within the Callback.

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

	return key;
    
public javax.security.auth.message.callback.PrivateKeyCallback$RequestgetRequest()
Used by the CallbackHandler to get the Request object that identifies the private key to be returned.

return
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.

	return request;
    
public voidsetKey(java.security.PrivateKey key, java.security.cert.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.

param
key The private key, or null.
param
chain The corresponding certificate chain, or null.

	this.key = key;
	this.chain = chain;