com.ibm.security.pkcs10
Class CertificationRequestInfo

java.lang.Object
  |
  +--com.ibm.security.pkcsutil.PKCSDerObject
        |
        +--com.ibm.security.pkcs10.CertificationRequestInfo

public final class CertificationRequestInfo
extends PKCSDerObject
implements Cloneable

Implements the ASN.1 CertificationRequestInfo type as defined in PKCS #10. This information is part of a CertificationRequest.

CertificationRequestInfo ::= SEQUENCE { version Version, subject Name, subjectPublicKeyInfo SubjectPublicKeyInfo, attributes [0] IMPLICIT Attributes } SubjectKeyInfo ::= SEQUENCE { algorithm AlgorithmIdentifier, publicKey BIT STRING }

CertificationRequestInfo objects are immutable; they cannot be changed once created.

See Also:
AlgorithmId, CertificationRequest

Fields inherited from class com.ibm.security.pkcsutil.PKCSDerObject
provider
 
Constructor Summary
CertificationRequestInfo(byte[] der)
          Create a CertificationRequestInfo object with a DER byte array.
CertificationRequestInfo(byte[] der, String provname)
          Create a CertificationRequestInfo object with a DER byte array.
CertificationRequestInfo(String filename, boolean base64)
          Create a CertificationRequestInfo with the filename of the DER-encoded or BASE64-encoded object.
CertificationRequestInfo(String filename, boolean base64, String provname)
          Create a CertificationRequestInfo with the filename of the DER-encoded or BASE64-encoded object.
CertificationRequestInfo(X500Name subject, PublicKey key, PKCSAttributes attrs)
          Create a CertificationRequestInfo object with the specified values.
CertificationRequestInfo(X500Name subject, PublicKey key, PKCSAttributes attrs, String provname)
          Create a CertificationRequestInfo object with the specified values.
 
Method Summary
 Object clone()
          Creates a clone of this CertificationRequestInfo object.
protected  void decode(com.ibm.security.pkcs10.DerValue encoding)
          Initializes a CertificationRequestInfo object from a DerValue.
 void encode(OutputStream os)
          Encodes this object to an OutputStream.
 boolean equals(Object other)
          Determines if this CertificationRequestInfo object is equivalent to the input object.
 PKCSAttributes getAttributes()
          Returns a reference to the subject's attributes.
 X500Name getSubjectName()
          Returns a reference to the certificate subject name.
 PublicKey getSubjectPublicKeyInfo()
          Returns a copy of the public key info.
 BigInteger getVersion()
          Returns a reference to the version number.
 String toString()
          Returns a string representation of this CertificationRequestInfo object.
 
Methods inherited from class com.ibm.security.pkcsutil.PKCSDerObject
decode, decode, encode, getObjectIdentifier, hashCode, read, readBASE64, write, write, writeBASE64
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CertificationRequestInfo

public CertificationRequestInfo(byte[] der)
                         throws IOException
Create a CertificationRequestInfo object with a DER byte array.
Parameters:
der - a DER byte array encoding a CertificationRequestInfo object.
Throws:
IOException - on decoding errors.

CertificationRequestInfo

public CertificationRequestInfo(byte[] der,
                                String provname)
                         throws IOException
Create a CertificationRequestInfo object with a DER byte array.
Parameters:
der - a DER byte array encoding a CertificationRequestInfo object.
provname - the name of the java security provider the caller wishes to use
Throws:
IOException - on decoding errors.

CertificationRequestInfo

public CertificationRequestInfo(X500Name subject,
                                PublicKey key,
                                PKCSAttributes attrs)
Create a CertificationRequestInfo object with the specified values.
Parameters:
subject - the disinguished name of the certificate subject.
key - the public key being certified.
attrs - a set of attributes describing the certificate subject. This set may have zero or more elements. A null attrs argument implies a set with zero elements.
Throws:
IllegalArgumentException - if the subject or key info argument is null.

CertificationRequestInfo

public CertificationRequestInfo(X500Name subject,
                                PublicKey key,
                                PKCSAttributes attrs,
                                String provname)
Create a CertificationRequestInfo object with the specified values.
Parameters:
subject - the disinguished name of the certificate subject.
key - the public key being certified.
attrs - a set of attributes describing the certificate subject. This set may have zero or more elements. A null attrs argument implies a set with zero elements.
provname - the name of the java security provider the caller wishes to use
Throws:
IllegalArgumentException - if the subject or key info argument is null.

CertificationRequestInfo

public CertificationRequestInfo(String filename,
                                boolean base64)
                         throws IOException
Create a CertificationRequestInfo with the filename of the DER-encoded or BASE64-encoded object.
Parameters:
filename - name of the DER-encoded or base64-encoded object
base64 - true if BASE64-encoded, false if DER-encoded
Throws:
IOException - on decoding errors.

CertificationRequestInfo

public CertificationRequestInfo(String filename,
                                boolean base64,
                                String provname)
                         throws IOException
Create a CertificationRequestInfo with the filename of the DER-encoded or BASE64-encoded object.
Parameters:
filename - name of the DER-encoded or base64-encoded object
base64 - true if BASE64-encoded, false if DER-encoded
provname - the name of the java security provider the caller wishes to use
Throws:
IOException - on decoding errors.
Method Detail

encode

public void encode(OutputStream os)
            throws IOException
Encodes this object to an OutputStream.
Overrides:
encode in class PKCSDerObject
Parameters:
os - the OutputStream to write the encoded data to.
Throws:
IOException - on encoding errors.

equals

public boolean equals(Object other)
Determines if this CertificationRequestInfo object is equivalent to the input object.
Overrides:
equals in class PKCSDerObject
Parameters:
other - the object to compare this one to.
Returns:
true, if the two objects are equivalent, false otherwise.

toString

public String toString()
Returns a string representation of this CertificationRequestInfo object.
Overrides:
toString in class PKCSDerObject
Returns:
a string representation of this object.

clone

public Object clone()
Creates a clone of this CertificationRequestInfo object.
Overrides:
clone in class Object
Returns:
clone of this CertificationRequestInfo object.

getVersion

public BigInteger getVersion()
Returns a reference to the version number. The version number is an immutable object.
Returns:
the version number for this object.

getSubjectName

public X500Name getSubjectName()
Returns a reference to the certificate subject name. The subject name is * an immutable object.
Returns:
the certificate subject name for this object.

getSubjectPublicKeyInfo

public PublicKey getSubjectPublicKeyInfo()
                                  throws InvalidKeyException,
                                         IOException
Returns a copy of the public key info.
Returns:
the public key info for this object.
Throws:
InvalidKeyException - if a copy of the public key info cannot be generated.

getAttributes

public PKCSAttributes getAttributes()
Returns a reference to the subject's attributes. The attributes object is immutable.
Returns:
the subject attributes for this object.

decode

protected void decode(com.ibm.security.pkcs10.DerValue encoding)
               throws IOException
Initializes a CertificationRequestInfo object from a DerValue. The DER encoding must be in the format specified by the CertificationRequestInfo ASN.1 notation.
Parameters:
encoding - a DER-encoded CertificationRequestInfo object.
Throws:
IOException - on parsing error.