public class QCStatements extends V3Extension
QCStatements
Extension.
The QCStatements
qualified certificate extension is specified by
the PKIX
Qualified Certificate Profile (RFC 3739).
The QCStatements extension is associated with a specific
certificateExtension
object identifier, derived from:
id-pkix OBJECT IDENTIFIER ::= { iso(1) identified-organization(3) dod(6) internet(1) security(5) mechanisms(5) pkix(7) } id-pe OBJECT IDENTIFIER ::= { id-pkix 1 } id-pe-qcStatements OBJECT IDENTIFIER ::= { id-pe 3 }
which corresponds to the OID string "1.3.6.1.5.5.7.1.3".
The Qualified Certificate profile specifies the QCStatements extension for
including defined statements related to a qualified certificate.
ASN.1 definition:
QCStatements ::= SEQUENCE OF QCStatement
Each 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 }The QCStatement type is implemented by class
QCStatement
which 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 of class QCStatement
, 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.
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 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
,
QCStatement
Modifier and Type | Field and Description |
---|---|
static ObjectID |
oid
The object identifier of this QCStatements extension.
|
critical
Constructor and Description |
---|
QCStatements()
Default constructor.
|
QCStatements(QCStatement[] qcStatements)
Creates an
QCStatements object and adds the given QCStatement
objects. |
Modifier and Type | Method and Description |
---|---|
ObjectID |
getObjectID()
Returns the object ID of this
QCStatements extension |
QCStatement |
getQCStatement(ObjectID statementID)
Searches this QCStatements extension for an QCStatement with the given
statementID.
|
QCStatement[] |
getQCStatements()
Returns the QCStatement objects included in this QCStatements extension.
|
QCStatement |
getQCStatements(ObjectID statementID)
Deprecated.
use
getQCStatement(ObjectID) instead |
QCStatementInfo |
getStatementInfo(ObjectID statementID)
Searches this QCStatements extension for an QCStatement with the given
statementID and returns its QCStatementInfo.
|
int |
hashCode()
Returns a hashcode for this identity.
|
void |
init(ASN1Object obj)
Inits this
QCStatements implementation with an ASN1object
representing the value of this extension. |
void |
setQCStatements(QCStatement[] qcStatements)
Sets the QCStatement objects of this QCStatements extension.
|
ASN1Object |
toASN1Object()
Returns an ASN1Object representing the value of this
QCStatements extension object. |
java.lang.String |
toString()
Returns a string that represents the contents of this
QCStatements extension. |
getName, isCritical, setCritical
public static final ObjectID oid
public QCStatements()
QCStatements
object.public QCStatements(QCStatement[] qcStatements)
QCStatements
object and adds the given QCStatement
objects.qcStatements
- the QCStatement objects to be included into this QCStatements
extensionpublic ObjectID getObjectID()
QCStatements
extensiongetObjectID
in class V3Extension
public void setQCStatements(QCStatement[] qcStatements)
qcStatements
- the QCStatement objects to be included into this QCStatements
extensionpublic QCStatement[] getQCStatements()
public QCStatement getQCStatements(ObjectID statementID)
getQCStatement(ObjectID)
insteadstatementID
- the statementID to search fornull
if no statement with the requested ID is includedpublic QCStatement getQCStatement(ObjectID statementID)
statementID
- the statementID to search fornull
if no statement with the requested ID is includedpublic QCStatementInfo getStatementInfo(ObjectID statementID)
getQCStatement(ObjectID statementID)
but already returns the QCStatementInfo
of the QCStatement searched for.statementID
- the statementID to search fornull
if no statement with the requested ID is includedpublic void init(ASN1Object obj) throws X509ExtensionException
QCStatements
implementation with an ASN1object
representing the value of this extension.
The given ASN1Object consists of a Sequence of QCStatement objects included
in the QCStatements
object.
The given ASN1Object is the one created by toASN1Object()
.
This method is used by the X509Extensions
class when parsing the ASN.1 representation of a certificate for properly
initializing an included QCStatements extension. This method initializes
the extension only with its value, but not with its critical specification.
For that reason, this method shall not be explicitly called by an
application.
init
in class V3Extension
obj
- the QCStatements as ASN1ObjectX509ExtensionException
- if the extension could not be parsedpublic ASN1Object toASN1Object() throws X509ExtensionException
QCStatements
extension object.
The ASN1Object is an ASN.1 Sequence including any QCStatement that has been
added to this QCStatements
object.
QCStatements ::= SEQUENCE OF QCStatement
toASN1Object
in class V3Extension
QCStatements
as ASN1ObjectX509ExtensionException
- if the extension could not be createdpublic int hashCode()
hashCode
in class V3Extension
public java.lang.String toString()
QCStatements
extension.toString
in class java.lang.Object