com.ibm.security.pkcs7
Class OriginatorInfo

java.lang.Object
  |
  +--com.ibm.security.pkcsutil.PKCSDerObject
        |
        +--com.ibm.security.pkcs7.OriginatorInfo

public final class OriginatorInfo
extends PKCSDerObject
implements Cloneable

Implements the ASN.1 OriginatorInfo type. It is mainly used in OriginatorInfo to give further information on the originator's certificates and CRLs. It is present in EnvelopedData objects only if required by the key management algorithm.

OriginatorInfo ::= SEQUENCE { certs [0] IMPLICIT CertificateSet OPTIONAL, crls [1] IMPLICIT CertificateRevocationLists OPTIONAL, }

Only X509Certificate and X509CRL objects are supported for certificates and crls respectively.

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

See Also:
Certificate, CRL

Fields inherited from class com.ibm.security.pkcsutil.PKCSDerObject
provider
 
Constructor Summary
OriginatorInfo(byte[] der)
          Create an OriginatorInfo object with a DER byte array.
OriginatorInfo(byte[] der, String provider)
          Create an OriginatorInfo object with a DER byte array.
OriginatorInfo(Certificate[] certsIn, CRL[] crlsIn)
          Create an OriginatorInfo object with the specified values.
OriginatorInfo(Certificate[] certsIn, CRL[] crlsIn, String provider)
          Create an OriginatorInfo object with the specified values.
OriginatorInfo(String filename, boolean base64)
          Create an OriginatorInfo with the filename of the DER-encoded or BASE64-encoded object.
OriginatorInfo(String filename, boolean base64, String provider)
          Create an OriginatorInfo with the filename of the DER-encoded or BASE64-encoded object.
 
Method Summary
 Object clone()
          Creates a clone of this OriginatorInfo.
protected  void decode(com.ibm.security.pkcs7.DerValue encoding)
          Initializes an OriginatorInfo object from a DerValue.
 void encode(OutputStream os)
          Encodes this object to an OutputStream.
 boolean equals(Object other)
          Determines if this OriginatorInfo object is equivalent to the input object.
 Certificate[] getCertificates()
          Returns a copy of the set of signing certificates in an array of certificates.
 CRL[] getCRLs()
          Returns a copy of the set of CRLs in an array of CRLs.
 String toString()
          Returns a string representation of this OriginatorInfo 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

OriginatorInfo

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

OriginatorInfo

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

OriginatorInfo

public OriginatorInfo(Certificate[] certsIn,
                      CRL[] crlsIn)
Create an OriginatorInfo object with the specified values. Only X.509 certificates and certificate revocation lists are supported at this time.
Parameters:
certsIn - an array of the originator's X.509 certificates.
crlsIn - an array of the originator's X.509 certificate revocation lists.
Throws:
IllegalArgumentException - if the input certificates or CRL types are unsupported.

OriginatorInfo

public OriginatorInfo(Certificate[] certsIn,
                      CRL[] crlsIn,
                      String provider)
Create an OriginatorInfo object with the specified values. Only X.509 certificates and certificate revocation lists are supported at this time.
Parameters:
certsIn - an array of the originator's X.509 certificates.
crlsIn - an array of the originator's X.509 certificate revocation lists.
provider - the name of the java provider to use
Throws:
IllegalArgumentException - if the input certificates or CRL types are unsupported.

OriginatorInfo

public OriginatorInfo(String filename,
                      boolean base64)
               throws IOException
Create an OriginatorInfo 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.

OriginatorInfo

public OriginatorInfo(String filename,
                      boolean base64,
                      String provider)
               throws IOException
Create an OriginatorInfo 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
provider - the name of the java security provider to use
Throws:
IOException - on decoding errors.
Method Detail

clone

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

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.

decode

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

equals

public boolean equals(Object other)
Determines if this OriginatorInfo 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.

getCertificates

public Certificate[] getCertificates()
Returns a copy of the set of signing certificates in an array of certificates. Since the certificates are stored in a set, they may not be returned in the same order as they were added.
Returns:
the array of signing certificates.

getCRLs

public CRL[] getCRLs()
Returns a copy of the set of CRLs in an array of CRLs. Since the CRLs are stored in a set, they may not be returned in the same order as they were added.
Returns:
the array of CRLs.

toString

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