|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.security.cert.CRL iaik.cms.OtherRevocationInfo
public class OtherRevocationInfo
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.
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 |
---|
public OtherRevocationInfo(ObjectID otherRevInfoFormat, ASN1Object otherRevInfo) throws CodingException
otherRevInfo
component of the
RFC 5652 OtherRevocationInfoFormat sequence:
OtherRevocationInfoFormat ::= SEQUENCE { otherRevInfoFormat OBJECT IDENTIFIER, otherRevInfo ANY DEFINED BY otherRevInfoFormat }
otherRevInfoFormat
- the OID identifying the other RevocationInfootherRevInfo
- the other RevocationInfo as ASN.1 object
CodingException
public OtherRevocationInfo(ObjectID otherRevInfoFormat, byte[] array) throws CodingException
otherRevInfo
component of the RFC 5652 OtherRevocationInfoFormat sequence:
OtherRevocationInfoFormat ::= SEQUENCE { otherRevInfoFormat OBJECT IDENTIFIER, otherRevInfo ANY DEFINED BY otherRevInfoFormat }
otherRevInfoFormat
- the OID identifying the other RevocationInfoarray
- the DER encoded other RevocationInfo
CodingException
public OtherRevocationInfo(ObjectID otherRevInfoFormat, java.io.InputStream is) throws CodingException
otherRevInfo
component of the RFC 5652 OtherRevocationInfoFormat sequence:
OtherRevocationInfoFormat ::= SEQUENCE { otherRevInfoFormat OBJECT IDENTIFIER, otherRevInfo ANY DEFINED BY otherRevInfoFormat }
otherRevInfoFormat
- the OID identifying the other RevocationInfois
- an input stream from which to read the DER encoded other RevocationInfo
CodingException
Method Detail |
---|
public ObjectID getOtherRevInfoFormat()
public void decode(ASN1Object otherRevInfo) throws CodingException
otherRevInfo
component of the
RFC 5652 OtherRevocationInfoFormat sequence:
OtherRevocationInfoFormat ::= SEQUENCE { otherRevInfoFormat OBJECT IDENTIFIER, otherRevInfo ANY DEFINED BY otherRevInfoFormat }
decode
in interface ASN1Type
otherRevInfo
- the ASN.1 other RevocationInfo
CodingException
- if an error occurs when parsing the other RevocationInfopublic ASN1Object toASN1Object()
otherRevInfo
component of the RFC 5652 OtherRevocationInfoFormat sequence:
OtherRevocationInfoFormat ::= SEQUENCE { otherRevInfoFormat OBJECT IDENTIFIER, otherRevInfo ANY DEFINED BY otherRevInfoFormat }
toASN1Object
in interface ASN1Type
public byte[] getEncoded() throws CodingException
otherRevInfo
component of the RFC 5652 OtherRevocationInfoFormat sequence:
OtherRevocationInfoFormat ::= SEQUENCE { otherRevInfoFormat OBJECT IDENTIFIER, otherRevInfo ANY DEFINED BY otherRevInfoFormat }
CodingException
- if an error occurs during the encoding procedurepublic boolean isRevoked(java.security.cert.Certificate cert)
java.security.cert.CRL
but generally
not supported OtherRevocationInfo.
isRevoked
in class java.security.cert.CRL
public java.lang.String toString()
otherRevInfo
component of the RFC 5652 OtherRevocationInfoFormat
sequence:
OtherRevocationInfoFormat ::= SEQUENCE { otherRevInfoFormat OBJECT IDENTIFIER, otherRevInfo ANY DEFINED BY otherRevInfoFormat }
toString
in class java.security.cert.CRL
|
This Javadoc may contain text parts from text parts from IETF Internet Standard specifications (see copyright note). | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |