iaik.x509.extensions.qualified.structures
Class QCStatement

java.lang.Object
  |
  +--iaik.x509.extensions.qualified.structures.QCStatement
All Implemented Interfaces:
ASN1Type

public class QCStatement
extends Object
implements ASN1Type

This class implements the QCStatement type.

The PKIX Qualified Certificate Profile specifies the Qualified Certificate Statements (QCStatements) extension for including defined statements related to Qualified Certificates. The QCStatements extension simply consists of a ASN.1 SEQUENCE of QC statements:

 QCStatements ::= SEQUENCE OF QCStatement
 
Each QC statement itself consists of an object identifier and an optional statement info identified by the object identifer (statement ID):
 QCStatement ::= SEQUENCE {
   statementId OBJECT IDENTIFIER,
   statementInfo ANY DEFINED BY statementId OPTIONAL }
 
This class includes a static part to be used for registering implementations for particular (private) statement infos. A statement info may be implemented by extending the abstract QCStatementInfo class and registering it by calling the static register method, e.g.:
 public class MyQCStatementInfo extends QCStatementInfo {
 ...
 // the statement id:
   public static final ObjectID statementID = ...;
 ...
 }
 ...
 // register the implementation:
 QCStatement.register(MyQCStatementInfo.statementID, MyQCStatementInfo.class);
 
The Qualified Certificate Profile currently defines one statement info which already is implemented and registered: Additionally the following statement infos from the ETSI qualified certificate profile are registered: For any desired QCStatementInfo to be included into a qualified certificate create a QCStatement object and subsequently add the QCStatement objects to a QCStatements certificate extension. The following example creates a QCStatement for a SemanticsInformation statement info and adds it to a QCStatements extension:
 ObjectID semanticsIdentifier = ...;
 GeneralName[] nameRegistrationAuthorities = ...;
 // create the SemanticsInformation:
 SemanticsInformation semanticsInformation =
   new SemanticsInformation(semanticsIdentifier, nameRegistrationAuthorities);
 // create a QCStatement for the SemanticsInformation:
 QCStatement[] qcStatements = ...;
 qcStatements[0] = new QCStatement(semanticsInformation);
 // add any further QCStatements
 ...
 // Create a QCStatements extension from the QCStatements:
 QCStatements qcStatementsExt = new QCStatements(qcStatements);
 
For adding a QCStatements extension object to a QualifiedCertificate, use the addExtension or setQCStatements method of the QualifiedCertificate class:

 QualifiedCertificate cert = new QualifiedCertificate();
   ...
 cert.setQCStatements(qcStatementsExt);
 

Version:
File Revision 13
See Also:
QCStatementInfo, QCStatements

Constructor Summary
QCStatement()
          Default Constructor.
QCStatement(ObjectID statementID)
          Creates an QCStatement for the supplied statement ID.
QCStatement(QCStatementInfo statementInfo)
          Creates an QCStatement from the supplied statementInfo.
 
Method Summary
static QCStatementInfo create(ObjectID statementID)
          Returns the implementation of the specified statement info defined through an ASN.1 ObjectID.
 void decode(ASN1Object obj)
          Decodes an QCStatement from its ASN.1 representation.
 ObjectID getStatementID()
          Gets the statementID of this QCStatement.
 QCStatementInfo getStatementInfo()
          Gets the statementInfo of this QCStatement.
static void register(ObjectID statementID, Class cl)
          Registers a class for implementing a particular statement info.
 ASN1Object toASN1Object()
          Returns this QCStatement as ASN1Object.
 String toString()
          Returns a String representation of the QCStatement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

QCStatement

public QCStatement()
Default Constructor. Creates an empty QCStatement object. This constructor only is used for dynamic object creation and shall not be used by an application.

QCStatement

public QCStatement(ObjectID statementID)
Creates an QCStatement for the supplied statement ID. This constructor may be used for creating a QCStatement having no statement info.
Parameters:
statementID - the statementID of this QCStatement

QCStatement

public QCStatement(QCStatementInfo statementInfo)
Creates an QCStatement from the supplied statementInfo. The statement id is obtained from the supplied statement info.
Parameters:
statementInfo - the statementInfo of this QCStatement
Method Detail

create

public static QCStatementInfo create(ObjectID statementID)
                              throws InstantiationException
Returns the implementation of the specified statement info defined through an ASN.1 ObjectID.

This method belongs to the static part of this class.

Parameters:
oid - the ObjectID of the statement info.
Returns:
the implementation of the statement info with this statementID
Throws:
InstantiationException - if the internal factory couldn't create an instance of requested type

register

public static void register(ObjectID statementID,
                            Class cl)
Registers a class for implementing a particular statement info.

This method belongs to the static part of this class.

Parameters:
statementID - the statementID of the statement info to be registered
class - the class which implements this statement info

getStatementInfo

public QCStatementInfo getStatementInfo()
Gets the statementInfo of this QCStatement.
Returns:
the statementInfo of this QCStatement

getStatementID

public ObjectID getStatementID()
Gets the statementID of this QCStatement.
Returns:
the statementID of this QCStatement

decode

public void decode(ASN1Object obj)
            throws CodingException
Decodes an QCStatement from its ASN.1 representation. This method parses the statement id from the supplied ASN.1 representation and tries -- if a statement info is included -- to find an registered statement info implementation for the parsed statement ID. If no statement info implementation can be found, a UnknownQCStatementInfo object is created for the unknown statement info allowing to query for information about the statement info.
Specified by:
decode in interface ASN1Type
Parameters:
obj - the QCStatement as ASN1Object
Throws:
CodingException - if the ASN1Object cannot be parsed

toASN1Object

public ASN1Object toASN1Object()
                        throws CodingException
Returns this QCStatement as ASN1Object.
Specified by:
toASN1Object in interface ASN1Type
Returns:
this QCStatement as ASN1Object.
Throws:
CodingException - if the QCStatement cannot be represented as ASN1Object

toString

public String toString()
Returns a String representation of the QCStatement.
Overrides:
toString in class Object
Returns:
a String representation of the QCStatement.

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