public class QCStatement extends java.lang.Object implements ASN1Type
The PKIX
Qualified Certificate Profile (RFC 3739) 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 QCStatementEach QC statement itself consists of an object identifier and an optional statement info identified by the object identifier (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);Note that the
statementID
used for registering a statementInfo
implementing class belongs to the QCStatement for which the statementInfo is
used. For instance, the Qualified Certificate Profile currently defines one statement info,
SemanticsInformation
,
to may be used for the QCSyntaxV1
and QCSyntaxV2
QC statements.
Additionally the following statement infos from the ETSI qualified certificate profile are implemented by IAIK-JCE:
For any desired QCStatementInfo to be included into a qualified certificate create aQCStatement
object
and subsequently add the QCStatement objects to a QCStatements
certificate extension. The following example creates a QCSyntaxV2
QCStatement with
a SemanticsInformation
statement info and adds it to a QCStatements extension:
ObjectID semanticsIdentifier = ...; GeneralName[] nameRegistrationAuthorities = ...; // create the QCSyntaxV2: QCSyntaxV2 semanticsInformation = new QCSyntaxV2(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);If the QCStatement you are using does not have a
statementInfo
component, simply create a QCStatement
object for the particular
statementID
. For instance, you may use a QCSyntaxV2
to specify conformance with version 2 of the PKIX qualified certificate
profile:
... QCStatement[] qcStatements = ...; qcStatements[0] = new QCStatement(QCSyntaxV2.statementID); ...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);
QCStatementInfo
,
QCStatements
Constructor and Description |
---|
QCStatement()
Default Constructor.
|
QCStatement(ObjectID statementID)
Creates an QCStatement for the supplied statement ID.
|
QCStatement(QCStatementInfo statementInfo)
Creates an QCStatement from the supplied statementInfo.
|
Modifier and Type | Method and Description |
---|---|
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,
java.lang.Class cl)
Registers a class for implementing a particular statement info.
|
ASN1Object |
toASN1Object()
Returns this QCStatement as ASN1Object.
|
java.lang.String |
toString()
Returns a String representation of the QCStatement.
|
public QCStatement()
public QCStatement(ObjectID statementID)
statementID
- the statementID of this QCStatementpublic QCStatement(QCStatementInfo statementInfo)
statementInfo
- the statementInfo of this QCStatementpublic static QCStatementInfo create(ObjectID statementID) throws java.lang.InstantiationException
This method belongs to the static part of this class.
statementID
- the ObjectID of the statement info.java.lang.InstantiationException
- if the internal factory
couldn't create an instance of requested typepublic static void register(ObjectID statementID, java.lang.Class cl)
This method belongs to the static part of this class.
statementID
- the statementID of the statement info to be registeredcl
- the class which implements this statement infopublic QCStatementInfo getStatementInfo()
public ObjectID getStatementID()
public void decode(ASN1Object obj) throws CodingException
UnknownQCStatementInfo
object is created for the unknown statement info
allowing to query for information about the statement info.decode
in interface ASN1Type
obj
- the QCStatement as ASN1ObjectCodingException
- if the ASN1Object cannot be parsedpublic ASN1Object toASN1Object() throws CodingException
toASN1Object
in interface ASN1Type
CodingException
- if the QCStatement cannot be represented as ASN1Objectpublic java.lang.String toString()
toString
in class java.lang.Object