com.rsa.certj.cert.extensions

Class SemanticsInformation

java.lang.Object
  |
  +--com.rsa.certj.cert.extensions.SemanticsInformation
All Implemented Interfaces:
Cloneable, Serializable

public class SemanticsInformation
extends Object
implements Cloneable, Serializable

This class is used in QC Statements extension in Qualified Certificates.

The ASN.1 definition is as follows:

 SemanticsInformation ::= SEQUENCE {
   semanticsIdentifier         OBJECT IDENTIFIER OPTIONAL
   nameRegistrationAuthorities NameRegistrationAuthorities OPTIONAL 
 } -- At least one field shall be present

 NameRegistrationAuthorities ::= SEQUENCE SIZE (1...MAX) OF GeneralName

 id-qcs-pkixQCSyntax-v1   OBJECT IDENTIFIER ::= { id-qcs 1 }
 
The SementicsInformation component identified by id-qcs- pkixQCSyntax-v1 MAY contain a semantics identifier and MAY identify one or more name registration authorities.

The semanticsIdentifier component, if present, SHALL contain an OID, defining semantics for attributes and names in basic certificate fields and certificate extensions. The OID may define semantics for all, or for a subgroup of all present attributes and/or names.

The NameRegistrationAuthorities component, if present, SHALL contain a name of one or more name registration authorities, responsible for registration of attributes or names associated with the subject. The association between an identified name registration authority and present attributes MAY be defined by a semantics identifier OID, by a certificate policy (or CPS) or some other implicit factors.

Copyright © RSA Security Inc., 2002. All rights reserved.

See Also

Serialized Form

Constructor Summary

SemanticsInformation()

Constructs an empty SemanticsInformation object.

SemanticsInformation(byte[] infoBER, int offset, int special)

Creates a SemanticsInformation object and initializes it with the given values.

 

Method Summary

 Object

clone()

Overrides the default clone method to get a deeper clone.

 boolean

equals(Object obj)

Returns true if this object and obj contain the same SemanticsInformation; returns false otherwise.

 int

getDEREncoding(byte[] encoding, int offset, int special)

Places the DER encoding of this SemanticsInformation object into encoding, beginning at offset.

 int

getDERLen(int special)

Returns the number of bytes that will be used by the DER encoding of this SemanticsInformation object.

 byte[]

getID()

Gets a semanticsIdentifier value.

 GeneralNames

getName()

Gets a nameRegistrationAuthorities value

static int

getNextBEROffset(byte[] valueBER, int offset)

Given valueBER, the BER encoding of a SemanticsInformation object beginning at offset, finds the index to the next element in the encoding.

 void

setID(byte[] id, int offset, int len)

Sets a semanticsIdentifier component to this id containing an OID, which defines semantics for attributes and names in basic certificate fields and certificate extensions.

 void

setName(GeneralNames name)

Sets a nameRegistrationAuthorities field to this name, containing a name of one or more name registration authorities, responsible for registration of attributes or names associated with the subject.

 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SemanticsInformation

public SemanticsInformation(byte[] infoBER,
                            int offset,
                            int special)
                     throws NameException
Creates a SemanticsInformation object and initializes it with the given values.

Parameters

         infoBER  

A byte array containing the BER encoding of this object.

         offset  

The offset into the infoBER array.

         special  

The special instructions of the BER encoding, if there are any. The following ASN.1 constants are possible values for special: APP_IMPLICIT, APP_EXPLICIT, PRIVATE_IMPLICIT, PRIVATE_EXPLICIT, OPTIONAL, DEFAULT, CONTEXT_IMPLICIT, or CONTEXT_EXPLICIT.

Throws

NameException - If the encoding is invalid.

SemanticsInformation

public SemanticsInformation()
Constructs an empty SemanticsInformation object.
Method Detail

setName

public void setName(GeneralNames name)
Sets a nameRegistrationAuthorities field to this name, containing a name of one or more name registration authorities, responsible for registration of attributes or names associated with the subject. If passed in value in null, it sets the nameRegistrationAuthorities component to null.

Parameters

         name  

name registration authorities


getName

public GeneralNames getName()
Gets a nameRegistrationAuthorities value

Returns

a name of one or more name registration authorities, responsible for registration of attributes or names associated with the subject.

setID

public void setID(byte[] id,
                  int offset,
                  int len)
Sets a semanticsIdentifier component to this id containing an OID, which defines semantics for attributes and names in basic certificate fields and certificate extensions. If passed in value in null, it sets the semanticsIdentifier component to null.

Parameters

         id  

Semantics Identifier

         offset  

the offset into id array

         len  

the length of the Semantics Identifier value in id array


getID

public byte[] getID()
Gets a semanticsIdentifier value.

Returns

an OID defining semantics for attributes and names in basic certificate fields and certificate extensions.

getNextBEROffset

public static int getNextBEROffset(byte[] valueBER,
                                   int offset)
                            throws NameException
Given valueBER, the BER encoding of a SemanticsInformation object beginning at offset, finds the index to the next element in the encoding. In other words, this method gets the next offset after the SemanticsInformation object.

For example, if the offset is 120 and the SemanticsInformation object's BER encoding is 1819 bytes, then this method will return 1939, the index immediately following the SemanticsInformation object. That is, valueBER[120] is the first byte in the encoding of the SemanticsInformation object, valueBER[1938] is the last byte in the encoding of the SemanticsInformation object, and the next element begins at index 1939.

Parameters

         valueBER  

The BER encoding of this SemanticsInformation object.

         offset  

The offset into valueBER where the encoding begins.

Returns

The index to the next element in the BER encoding.

Throws

NameException - If the method cannot read the BER encoding.

getDERLen

public int getDERLen(int special)
              throws NameException
Returns the number of bytes that will be used by the DER encoding of this SemanticsInformation object. If this object is not set with values, then this method returns zero.

Parameters

         special  

The special circumstances of the DER encoding, if there are any. The following ASN.1 constants are possible values for special: APP_IMPLICIT, APP_EXPLICIT, PRIVATE_IMPLICIT, PRIVATE_EXPLICIT, OPTIONAL, DEFAULT, CONTEXT_IMPLICIT, or CONTEXT_EXPLICIT.

Returns

The number of bytes that will be used by the DER encoding of this SemanticsInformation object.

Throws

NameException - if there is an error in encoding

getDEREncoding

public int getDEREncoding(byte[] encoding,
                          int offset,
                          int special)
                   throws NameException
Places the DER encoding of this SemanticsInformation object into encoding, beginning at offset. To determine the length of the encoding, call getDERLen. If this object is not yet set with values, then this method places nothing into the array and returns zero. To indicate that the DER encoding should follow any special instructions, use the special argument.

For example, to indicate the following:
      extension   [1] IMPLICIT Extension
 
pass in the following:
      special = (ASN1.CONTEXT_IMPLICIT | 1);
 

If there are no special circumstances, pass in the following:
      special = 0
 
The following ASN.1 constants are possible values for special: APP_IMPLICIT, APP_EXPLICIT, PRIVATE_IMPLICIT, PRIVATE_EXPLICIT, OPTIONAL, DEFAULT, CONTEXT_IMPLICIT, or CONTEXT_EXPLICIT.

Parameters

         encoding  

The byte array into which the result will be placed.

         offset  

The offset into encoding where writing begins.

         special  

The special circumstances of the DER encoding, if there are any. The following ASN.1 constants are possible values for special: APP_IMPLICIT, APP_EXPLICIT, PRIVATE_IMPLICIT, PRIVATE_EXPLICIT, OPTIONAL, DEFAULT, CONTEXT_IMPLICIT, or CONTEXT_EXPLICIT. are any.

Returns

The number of bytes placed into encoding.

Throws

NameException - If the method cannot create the DER encoding.

equals

public boolean equals(Object obj)
Returns true if this object and obj contain the same SemanticsInformation; returns false otherwise.

Overrides

equals in class Object

Parameters

         obj  

An instance of SemanticsInformation object.

Returns

A boolean that indicates whether these objects are equal.

clone

public Object clone()
             throws CloneNotSupportedException
Overrides the default clone method to get a deeper clone.

Returns

A new SemanticsInformation object, a copy of this object.

Throws

CloneNotSupportedException - If the cloning operation is not successful.


RSA BSAFE ® Cert-J 2.1.1 001-047007-211-001-000