javax.security.auth.message.callback
Class PrivateKeyCallback

java.lang.Object
  extended by javax.security.auth.message.callback.PrivateKeyCallback
All Implemented Interfaces:
Callback

public class PrivateKeyCallback
extends Object
implements Callback

Callback for private key and corresponding certificate chain.

Since:
May 11, 2006
Version:
$Revision: 45179 $
Author:
Anil Saldhana, Charlie Lai, Ron Monzillo (Javadoc for JSR-196)

Nested Class Summary
static class PrivateKeyCallback.AliasRequest
          Request type for private keys that are identified via an alias.
static class PrivateKeyCallback.IssuerSerialNumRequest
          Request type for private keys that are identified via an issuer/serial number.
static interface PrivateKeyCallback.Request
          Marker interface for private key request types.
static class PrivateKeyCallback.SubjectKeyIDRequest
          Request type for private keys that are identified via a SubjectKeyID
 
Constructor Summary
PrivateKeyCallback(PrivateKeyCallback.Request request)
          Constructs this PrivateKeyCallback with a private key Request object.
 
Method Summary
 Certificate[] getChain()
           
 PrivateKey getKey()
          Get the requested private key.
 PrivateKeyCallback.Request getRequest()
          Get the Request object which identifies the private key to be returned.
 void setKey(PrivateKey key, Certificate[] chain)
          Set the requested private key.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrivateKeyCallback

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 - identifier for the private key, or null.
Method Detail

getChain

public Certificate[] getChain()
Returns:

getKey

public PrivateKey getKey()
Get the requested private key.

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

getRequest

public PrivateKeyCallback.Request getRequest()
Get the Request object which 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.

setKey

public void setKey(PrivateKey key,
                   Certificate[] chain)

Set the requested private key.

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.


Copyright © 2008 JBoss Inc.. All Rights Reserved.