com.netscape.certsrv.base
Class KeyGenInfo

java.lang.Object
  extended by com.netscape.certsrv.base.KeyGenInfo

public class KeyGenInfo
extends java.lang.Object

The KeyGenInfo represents the information generated by the KeyGen tag of the HTML forms. It provides the parsing and accessing mechanisms.

 SignedPublicKeyAndChallenge ::= SEQUENCE {
      publicKeyAndChallenge PublicKeyAndChallenge,
      signatureAlgorithm AlgorithmIdentifier,
      signature BIT STRING
 }

 PublicKeyAndChallenge ::= SEQUENCE {
      spki SubjectPublicKeyInfo,
      challenge IA5STRING
 }

Version:
$Revision: 1211 $, $Date: 2010-08-18 10:15:37 -0700 (Wed, 18 Aug 2010) $

Constructor Summary
KeyGenInfo()
          Construct empty KeyGenInfo.
KeyGenInfo(java.lang.String spkac)
          Construct KeyGenInfo using the SignedPublicKeyAndChallenge string representation.
 
Method Summary
 void decode(java.lang.String spkac)
          Initialize using the SPKAC string
 byte[] encode()
          Der encoded into buffer
 netscape.security.x509.AlgorithmId getAlgorithmId()
          Get Algorithm ID
 java.lang.String getChallenge()
          Get Challenge phrase in string format
 netscape.security.util.DerValue getDerChallenge()
          Get Challenge phrase in DerValue form
 netscape.security.util.DerValue getDerSPKI()
          Get SPKI in DerValue form
 byte[] getSignature()
          Get Signature
 netscape.security.x509.X509Key getSPKI()
          Get SPKI as X509Key
 java.lang.String toString()
          String representation of KenGenInfo
 boolean validateChallenge(java.lang.String challenge)
          Validate Signature and Challenge Phrase
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

KeyGenInfo

public KeyGenInfo()
Construct empty KeyGenInfo. Need to call decode function later to initialize.


KeyGenInfo

public KeyGenInfo(java.lang.String spkac)
           throws java.io.IOException
Construct KeyGenInfo using the SignedPublicKeyAndChallenge string representation.

Parameters:
spkac - SignedPublicKeyAndChallenge string representation
Throws:
java.io.IOException
Method Detail

decode

public void decode(java.lang.String spkac)
            throws java.io.IOException
Initialize using the SPKAC string

Parameters:
spkac - SPKAC string from the end user
Throws:
java.io.IOException

encode

public byte[] encode()
Der encoded into buffer

Returns:
Der encoded buffer

getDerSPKI

public netscape.security.util.DerValue getDerSPKI()
Get SPKI in DerValue form

Returns:
SPKI in DerValue form

getSPKI

public netscape.security.x509.X509Key getSPKI()
Get SPKI as X509Key

Returns:
SPKI in X509Key form

getDerChallenge

public netscape.security.util.DerValue getDerChallenge()
Get Challenge phrase in DerValue form

Returns:
Challenge in DerValue form. null if none.

getChallenge

public java.lang.String getChallenge()
Get Challenge phrase in string format

Returns:
challenge phrase. null if none.

getSignature

public byte[] getSignature()
Get Signature

Returns:
signature

getAlgorithmId

public netscape.security.x509.AlgorithmId getAlgorithmId()
Get Algorithm ID

Returns:
the algorithm id

validateChallenge

public boolean validateChallenge(java.lang.String challenge)
Validate Signature and Challenge Phrase

Parameters:
challenge - phrase; null if none
Returns:
true if validated; otherwise, false

toString

public java.lang.String toString()
String representation of KenGenInfo

Overrides:
toString in class java.lang.Object
Returns:
string representation of KeGenInfo