iaik.x509
Class NetscapeCertRequest

java.lang.Object
  |
  +--iaik.x509.NetscapeCertRequest
All Implemented Interfaces:
CertRequest

public class NetscapeCertRequest
extends Object
implements CertRequest

This class represents a certificate request coming from Netscape Navigator 3.0 and 4.x.

This class only can be used for parsing an already existing NetscapeCertRequest, supplied in DER or PEM encoded format. Therefore this class provides two constructors for creating a NetscapeCertRequest from an InputStream, or from byte array supplying the PEM or DER encoded request. The given data is decoded and "translated" into a "SignedPublicKeyAndChallange" ASN.1 data structure as defined by the Netscape Certificate Specifications:

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

where:

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

For obtaining the public key from this "SignedPublicKeyAndChallange" structure, use the getPublicKey method. The self-signed "SignedPublicKeyAndChallange" structure can be verified using the verify method.

Version:
File Revision 17

Constructor Summary
NetscapeCertRequest(byte[] arr)
          Creates a NetscapeCertRequest from a byte array supplying the PEM or DER encoded request.
NetscapeCertRequest(InputStream is)
          Creates a NetscapeCertRequest from an InputStream supplying the PEM or DER encoded request.
 
Method Summary
 PublicKey getPublicKey()
          Returns the public key from this "SignedPublicKeyAndChallange" structure.
 boolean verify()
          Verifies the self signed certificate request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NetscapeCertRequest

public NetscapeCertRequest(InputStream is)
                    throws IOException,
                           CodingException
Creates a NetscapeCertRequest from an InputStream supplying the PEM or DER encoded request.

From the request derived from the given input stream the "SignedPublicKeyAndChallange" ASN.1 data structure is created.

Parameters:
is - the input stream from where to read the PEM/DER encoded cert request
Throws:
IOException - if an I/O error occurs.
CodingException - if the CertRequest could not be parsed

NetscapeCertRequest

public NetscapeCertRequest(byte[] arr)
                    throws CodingException
Creates a NetscapeCertRequest from a byte array supplying the PEM or DER encoded request.

From the request derived from the given byte array the "SignedPublicKeyAndChallange" ASN.1 data structure is created.

Parameters:
arr - the array containing the DER/PEM encoded CertRequest
Throws:
CodingException - if the CertRequest could not be parsed
Method Detail

verify

public boolean verify()
               throws SignatureException
Verifies the self signed certificate request.
Specified by:
verify in interface CertRequest
Returns:
true if the cert request is OK, false if not
Throws:
SignatureException - if the cert request could not be verified

getPublicKey

public PublicKey getPublicKey()
                       throws InvalidKeyException
Returns the public key from this "SignedPublicKeyAndChallange" structure.
Specified by:
getPublicKey in interface CertRequest
Returns:
the public key from this "SignedPublicKeyAndChallange" structure
Throws:
InvalidKeyException - if the public key from this "SignedPublicKeyAndChallange" structure cannot not be created

This Javadoc may contain text parts from Internet Standard specifications (RFC 2459, 3280, 3039, 2560, 1521, 821, 822, 2253, 1319, 1321, ,2630, 2631, 2268, 3058, 2984, 2104, 2144, 2040, 2311, 2279, see copyright note) and RSA Data Security Public-Key Cryptography Standards (PKCS#1,3,5,7,8,9,10,12, see copyright note).

IAIK-JCE 3.1 with IAIK-JCE CC Core 3.1, (c) 1997-2004 IAIK