net.cnri.dobj
Class PKAuthentication

java.lang.Object
  extended by net.cnri.dobj.AbstractAuthentication
      extended by net.cnri.dobj.PKAuthentication
All Implemented Interfaces:
DOAuthentication

public class PKAuthentication
extends net.cnri.dobj.AbstractAuthentication

A PKAuthentication object uses a private key to prove our identity. The certificate credentials are handled as part of the AbstractAuthentication parent class.


Constructor Summary
PKAuthentication(java.lang.String myID, java.security.PrivateKey myKey)
          Construct an authentication object that uses the given private key to prove that we are the entity identified by myID.
 
Method Summary
 net.cnri.dobj.AbstractAuthentication cloneAuthentication()
          The following must be implemented by subclasses of AbstractAuthentication in order to provide a copy of themselves for the purposes of authenticating when retrieving their credentials.
 java.lang.String getID()
          Returns the identifier representing the entity that is supposed to be authenticated by this object.
static java.lang.String getSigAlgForKeyAlg(java.lang.String keyAlg)
           
 void initialize()
           
 void signChallenge(net.cnri.dobj.HeaderSet challenge, net.cnri.dobj.HeaderSet response)
          Signs the given challenge message and puts the result (including any required parameters) into the given HeaderSet object.
 java.lang.String toString()
           
 
Methods inherited from class net.cnri.dobj.AbstractAuthentication
getAnonymousAuth, getCredentials, setAutoRetrieveCredentials
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PKAuthentication

public PKAuthentication(java.lang.String myID,
                        java.security.PrivateKey myKey)
Construct an authentication object that uses the given private key to prove that we are the entity identified by myID.

Method Detail

getID

public java.lang.String getID()
Returns the identifier representing the entity that is supposed to be authenticated by this object.

See Also:
DOAuthentication.getID()

cloneAuthentication

public net.cnri.dobj.AbstractAuthentication cloneAuthentication()
The following must be implemented by subclasses of AbstractAuthentication in order to provide a copy of themselves for the purposes of authenticating when retrieving their credentials. The returned object will have the autoRetrieveCredentials option turned off when retrieving the credentials in order to avoid a recursive loop when authenticating with the server that holds the credentials.

Specified by:
cloneAuthentication in class net.cnri.dobj.AbstractAuthentication

initialize

public void initialize()
                throws java.lang.Exception
Throws:
java.lang.Exception

signChallenge

public void signChallenge(net.cnri.dobj.HeaderSet challenge,
                          net.cnri.dobj.HeaderSet response)
                   throws java.lang.Exception
Description copied from interface: DOAuthentication
Signs the given challenge message and puts the result (including any required parameters) into the given HeaderSet object.

Throws:
java.lang.Exception

getSigAlgForKeyAlg

public static final java.lang.String getSigAlgForKeyAlg(java.lang.String keyAlg)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object