iaik.cms
Class OtherRevocationInfo

java.lang.Object
  extended by java.security.cert.CRL
      extended by iaik.cms.OtherRevocationInfo
All Implemented Interfaces:
ASN1Type
Direct Known Subclasses:
OCSPRevocationInfo

public class OtherRevocationInfo
extends java.security.cert.CRL
implements ASN1Type

This class implements the CMS type OtherRevocationInfo.

The Cryptographic Message Syntax (CMS) (RFC 5652) specifies the OtherRevocationInfoFormat type to allow to include any other (e.g. OCSP) revocation info format into a RevocationInfoChoices:

 RevocationInfoChoices ::= SET OF RevocationInfoChoice

 RevocationInfoChoice ::= CHOICE {
   crl CertificateList,
   other [1] IMPLICIT OtherRevocationInfoFormat }

 OtherRevocationInfoFormat ::= SEQUENCE {
   otherRevInfoFormat OBJECT IDENTIFIER,
   otherRevInfo ANY DEFINED BY otherRevInfoFormat }
 
Since -- as the name implies -- an other revocation info may represent any (other) revocation info format, this class only can provide a very generic view of an other revocation info. An application that implements some specific (custom) other revocationInfo type, may use this class to add a representant of the other revocationInfo type to a RevocationInfoChoices. Thereby the custom other revocationInfo has to be supplied as ASN1Object, e.g. (we assume that the custom other revocationInfo format is implemented by a class named MyOtherRevocationInfo):
 // create an instance of your custom other revocationInfo:
 MyOtherRevocationInfo myOtherRevocationInfo = ...;
 // get an ASN.1 representation of the custom other RevocationInfo:
 ASN1Object asn1MyOtherRevocationInfo = myOtherRevocationInfo.toASN1Object();
 // the oid that identifies the custom other RevocationInfo type:
 ObjectID myOtherRevInfoFormat = ...;
 // pack the custom other cert into an OtherRevocationInfo:
 OtherRevocationInfo otherRevocationInfo = new OtherRevocationInfo(myOtherRevInfoFormat, asn1MyOtherRevocationInfo);
 // create a RevocationInfoChoices and add the other RevocationInfo:
 RevocationInfoChoices revocationInfoChoices = new RevocationInfoChoices();
 revocationInfoChoices.addRevocationInfo(otherRevocationInfo);
 // add the RevocationInfoChoices set to a, e.g., SignedData object:
 SignedData signedData = ...;
 ...
 signedData.setRevocationInfoChoices(revocationInfoChoices);
 
The recipient may get the RevocationInfoChoices set from the SignedData object and parse the other RevocationInfo from its encoded or ASN.1 representation, e.g.:
 // the SignedData object, parsed from the received encoding:
 SignedData signedData = ...;
 ...
 // get the RevocationInfoChoices:
 RevocationInfoChoices revocationInfoChoices = signedData.getRevocationInfoChoices();
 // get any included other RevocationInfo:
 OtherRevocationInfo[] otherRevocationInfos = revocationInfoChoices.getOtherRevocationInfos();
 if (otherRevocationInfos.length > 0) {
   for (int i = 0; i < otherRevocationInfos.length; i++) {
     // check the format oid
     if (otherRevocationInfos[i].getOtherRevInfoFormat().equals(MyOtherRevocationInfo.otherRevInfoFormat)) {
       // create the custom other RevocationInfo format from its encoding:
       MyOtherRevocationInfo myOtherRevocationInfo = new MyOtherRevocationInfo(otherRevocationInfos[i].getEncoded());
       ...
     }
   }
 }
 
Currently IAIK-CMS does not provide any registration mechanism for other RevocationInfo format implementing classes. They may be handled as ASN.1 objects and transformed to/from its encoded representation as shown in the sample above. However, for OtherRevocationInfos of type id-ri-ocsp-response (1.3.6.1.5.5.7.16.2, RFC 5940) class OCSPRevocationInfo can be used.

This class is extended from java.security.cert.CRL to fit into the JCA CRL framework. However, since any actual custom other RevocationInfo format can not be known in advance, method isRevoked only throws a "Method not supported!" runtime exception. This method may be provided by the final other RevocationInfo implementation.

See Also:
RevocationInfoChoices

Constructor Summary
OtherRevocationInfo(ObjectID otherRevInfoFormat, ASN1Object otherRevInfo)
          Creates an OtherRevocationInfo from identifying OID format and ASN.1 representation.
OtherRevocationInfo(ObjectID otherRevInfoFormat, byte[] array)
          Creates an OtherRevocationInfo from identifying OID format and DER encoding.
OtherRevocationInfo(ObjectID otherRevInfoFormat, java.io.InputStream is)
          Creates an OtherRevocationInfo from identifying OID format and DER encoding.
 
Method Summary
 void decode(ASN1Object otherRevInfo)
          Decodes and parses the ASN.1 representation of the other RevocationInfo.
 byte[] getEncoded()
          Returns the DER encoded other RevocationInfo.
 ObjectID getOtherRevInfoFormat()
          Get the otherRevInfoFormat OID identifying the other RevocationInfo
 boolean isRevoked(java.security.cert.Certificate cert)
          Throws a RuntimeException since not supported.
 ASN1Object toASN1Object()
          Returns the other RevocationInfo as ASN1Object.
 java.lang.String toString()
          Gets a String representation of the other RevocationInfo.
 
Methods inherited from class java.security.cert.CRL
getType
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

OtherRevocationInfo

public OtherRevocationInfo(ObjectID otherRevInfoFormat,
                           ASN1Object otherRevInfo)
                    throws CodingException
Creates an OtherRevocationInfo from identifying OID format and ASN.1 representation. The given otherRevInfo represents the otherRevInfo component of the RFC 5652 OtherRevocationInfoFormat sequence:
 OtherRevocationInfoFormat ::= SEQUENCE {
   otherRevInfoFormat OBJECT IDENTIFIER,
   otherRevInfo ANY DEFINED BY otherRevInfoFormat }
 

Parameters:
otherRevInfoFormat - the OID identifying the other RevocationInfo
otherRevInfo - the other RevocationInfo as ASN.1 object
Throws:
CodingException

OtherRevocationInfo

public OtherRevocationInfo(ObjectID otherRevInfoFormat,
                           byte[] array)
                    throws CodingException
Creates an OtherRevocationInfo from identifying OID format and DER encoding. The given byte array represents the DER encoding of the otherRevInfo component of the RFC 5652 OtherRevocationInfoFormat sequence:
 OtherRevocationInfoFormat ::= SEQUENCE {
   otherRevInfoFormat OBJECT IDENTIFIER,
   otherRevInfo ANY DEFINED BY otherRevInfoFormat }
 

Parameters:
otherRevInfoFormat - the OID identifying the other RevocationInfo
array - the DER encoded other RevocationInfo
Throws:
CodingException

OtherRevocationInfo

public OtherRevocationInfo(ObjectID otherRevInfoFormat,
                           java.io.InputStream is)
                    throws CodingException
Creates an OtherRevocationInfo from identifying OID format and DER encoding. The given input stream supplies the DER encoding of the otherRevInfo component of the RFC 5652 OtherRevocationInfoFormat sequence:
 OtherRevocationInfoFormat ::= SEQUENCE {
   otherRevInfoFormat OBJECT IDENTIFIER,
   otherRevInfo ANY DEFINED BY otherRevInfoFormat }
 

Parameters:
otherRevInfoFormat - the OID identifying the other RevocationInfo
is - an input stream from which to read the DER encoded other RevocationInfo
Throws:
CodingException
Method Detail

getOtherRevInfoFormat

public ObjectID getOtherRevInfoFormat()
Get the otherRevInfoFormat OID identifying the other RevocationInfo

Returns:
the otherRevInfoFormat OID identifying the other RevocationInfo

decode

public void decode(ASN1Object otherRevInfo)
            throws CodingException
Decodes and parses the ASN.1 representation of the other RevocationInfo. The given otherRevInfo represents the otherRevInfo component of the RFC 5652 OtherRevocationInfoFormat sequence:
 OtherRevocationInfoFormat ::= SEQUENCE {
   otherRevInfoFormat OBJECT IDENTIFIER,
   otherRevInfo ANY DEFINED BY otherRevInfoFormat }
 

Specified by:
decode in interface ASN1Type
Parameters:
otherRevInfo - the ASN.1 other RevocationInfo
Throws:
CodingException - if an error occurs when parsing the other RevocationInfo

toASN1Object

public ASN1Object toASN1Object()
Returns the other RevocationInfo as ASN1Object. The ASN1Object returned by this method represents the otherRevInfo component of the RFC 5652 OtherRevocationInfoFormat sequence:
 OtherRevocationInfoFormat ::= SEQUENCE {
   otherRevInfoFormat OBJECT IDENTIFIER,
   otherRevInfo ANY DEFINED BY otherRevInfoFormat }
 

Specified by:
toASN1Object in interface ASN1Type
Returns:
the otherRevInfo as ASN.1 object

getEncoded

public byte[] getEncoded()
                  throws CodingException
Returns the DER encoded other RevocationInfo. The DER encoding returned by this method represents the otherRevInfo component of the RFC 5652 OtherRevocationInfoFormat sequence:
 OtherRevocationInfoFormat ::= SEQUENCE {
   otherRevInfoFormat OBJECT IDENTIFIER,
   otherRevInfo ANY DEFINED BY otherRevInfoFormat }
 

Returns:
the DER encoded otherRevInfo
Throws:
CodingException - if an error occurs during the encoding procedure

isRevoked

public boolean isRevoked(java.security.cert.Certificate cert)
Throws a RuntimeException since not supported. Method inherited from java.security.cert.CRL but generally not supported OtherRevocationInfo.

Specified by:
isRevoked in class java.security.cert.CRL

toString

public java.lang.String toString()
Gets a String representation of the other RevocationInfo. The String representation returned by this method represents the otherRevInfo component of the RFC 5652 OtherRevocationInfoFormat sequence:
 OtherRevocationInfoFormat ::= SEQUENCE {
   otherRevInfoFormat OBJECT IDENTIFIER,
   otherRevInfo ANY DEFINED BY otherRevInfoFormat }
 

Specified by:
toString in class java.security.cert.CRL
Returns:
a String representation of the otherRevInfo

This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note).

IAIK-CMS 6.0, (c) 2002 IAIK, (c) 2003, 2023 SIC