com.rsa.certj.cert.extensions

Class ORAddress

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

public class ORAddress
extends Object
implements Cloneable, Serializable

This class is used in the GeneralName object.

The ASN.1 definition is as follows:

 ORAddress ::= SEQUENCE {
   built-in-standard-attributes BuiltInStandardAttributes,
   built-in-domain-defined-attributes
                       BuiltInDomainDefinedAttributes OPTIONAL,
   extension-attributes ExtensionAttributes OPTIONAL }

 BuiltInStandardAttributes ::= SEQUENCE {
  country-name CountryName OPTIONAL,
  administration-domain-name AdministrationDomainName OPTIONAL,
  network-address      [0] NetworkAddress OPTIONAL,
  terminal-identifier  [1] TerminalIdentifier OPTIONAL,
  private-domain-name  [2] PrivateDomainName OPTIONAL,
  organization-name    [3] OrganizationName OPTIONAL,
  numeric-user-identifier      [4] NumericUserIdentifier OPTIONAL,
  personal-name        [5] PersonalName OPTIONAL,
  organizational-unit-names    [6] OrganizationalUnitNames OPTIONAL
 }
 
 BuiltInDomainDefinedAttributes ::= SEQUENCE SIZE
                               (1..ub-domain-defined-attributes) OF
                               BuiltInDomainDefinedAttribute

 BuiltInDomainDefinedAttribute ::= SEQUENCE {
  type PrintableString (SIZE
                       (1..ub-domain-defined-attribute-type-length)),
  value PrintableString (SIZE
                       (1..ub-domain-defined-attribute-value-length))}

 ExtensionAttributes ::= SET SIZE (1..ub-extension-attributes) OF
                       ExtensionAttribute

 ExtensionAttribute ::=  SEQUENCE {
   extension-attribute-type [0] INTEGER (0..ub-extension-attributes),
   extension-attribute-value [1]
                       ANY DEFINED BY extension-attribute-type }

Copyright © RSA Security Inc., 1999-2001. All rights reserved.

See Also

Serialized Form

Constructor Summary

ORAddress()

Constructs an empty ORAddress object.

ORAddress(byte[] valueBER, int offset, int special)

Constructs an ORAddress 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 ORAddress,returns false otherwise.

 BuiltInDomainDefinedAttributes

getBuiltInDomainDefinedAttributes()

Gets the BuiltInDomainDefinedAttributes value of this object.

 BuiltInStandardAttributes

getBuiltInStandardAttributes()

Gets the BuiltInStandardAttributes value of this object.

 int

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

Places the DER encoding of the ORAddress 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 ORAddress object.

 ExtensionAttributes

getExtensionAttributes()

Gets the ExtensionAttributes value of this object.

static int

getNextBEROffset(byte[] nameBER, int offset)

Given nameBER, the BER encoding of an ORAddress object, beginning at offset, finds the index to the next element in the encoding.

 void

setBuiltInDomainDefinedAttributes(BuiltInDomainDefinedAttributes attr)

Sets the BuiltInDomainDefinedAttributes value of this object.

 void

setBuiltInStandardAttributes(BuiltInStandardAttributes attr)

Sets the BuiltInStandardAttributes value of this object.

 void

setExtensionAttributes(ExtensionAttributes attr)

Sets the ExtensionAttributes value of this object.

 String

toString()

Returns a String that describes this ORAddress object.

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

Constructor Detail

ORAddress

public ORAddress(byte[] valueBER,
                 int offset,
                 int special)
          throws NameException
Constructs an ORAddress object and initializes it with the given values.

Parameters

         valueBER  

A byte array that contains the BER encoding of ORAddress.

         offset  

The offset into valueBER where the encoding begins.

         special  

The special instructions for 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.

ORAddress

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

setBuiltInStandardAttributes

public void setBuiltInStandardAttributes(BuiltInStandardAttributes attr)
Sets the BuiltInStandardAttributes value of this object.

Parameters

         attr  

A BuiltInStandardAttributes object.


setBuiltInDomainDefinedAttributes

public void setBuiltInDomainDefinedAttributes(BuiltInDomainDefinedAttributes attr)
Sets the BuiltInDomainDefinedAttributes value of this object.

Parameters

         attr  

A BuiltInDomainDefinedAttributes object.


setExtensionAttributes

public void setExtensionAttributes(ExtensionAttributes attr)
Sets the ExtensionAttributes value of this object.

Parameters

         attr  

A ExtensionAttributes object.


getBuiltInStandardAttributes

public BuiltInStandardAttributes getBuiltInStandardAttributes()
Gets the BuiltInStandardAttributes value of this object.

Returns

The BuiltInStandardAttributes object.

getBuiltInDomainDefinedAttributes

public BuiltInDomainDefinedAttributes getBuiltInDomainDefinedAttributes()
Gets the BuiltInDomainDefinedAttributes value of this object.

Returns

The BuiltInDomainDefinedAttributes object.

getExtensionAttributes

public ExtensionAttributes getExtensionAttributes()
Gets the ExtensionAttributes value of this object.

Returns

The ExtensionAttributes object.

toString

public String toString()
Returns a String that describes this ORAddress object.

Overrides

toString in class Object

Returns

A String that describes this ORAddress object.

getNextBEROffset

public static int getNextBEROffset(byte[] nameBER,
                                   int offset)
                            throws NameException
Given nameBER, the BER encoding of an ORAddress object, beginning at offset, finds the index to the next element in the encoding. In other words, gets the next offset after the name.

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

Parameters

         nameBER  

The BER encoding of an ORAddress object.

         offset  

The offset into nameBER 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)
Returns the number of bytes that will be used by the DER encoding of this ORAddress object. If this object is not set with values, this method returns zero.

Parameters

         special  

The special DER circumstances of the encoding, if there are any.

Returns

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

getDEREncoding

public int getDEREncoding(byte[] encoding,
                          int offset,
                          int special)
                   throws NameException
Places the DER encoding of the ORAddress 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 to begin writing.

         special  

The special circumstances of the DER encoding, if there are any.

Returns

The number of bytes actually 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 ORAddress,returns false otherwise.

Overrides

equals in class Object

Parameters

         obj  

An instance of an ORAddress 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 ORAddress 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