|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.rsa.certj.cert.extensions.GeneralNames
This class is used in several extensions; for example,
AuthorityKeyID
and CertificateIssuer
.
GeneralNames ::= SEQUENCE SIZE (1..MAX) OF GeneralName GeneralName ::= CHOICE { otherName [0] INSTANCE OF OTHER-NAME, rfc822Name [1] IA5String, dNSName [2] IA5String, x400Address [3] ORAddress, directoryName [4] Name, ediPartyName [5] EDIPartyName, uniformResourceIdentifier [6] IA5String, iPAddress [7] OCTET STRING, registeredID [8] OBJECT IDENTIFIER } |
GeneralName
type are names
of various forms, as follows:
nameAssigner
component
identifies an authority that assigns unique values of names in the
partyName
component.
See Also
Constructor Summary |
|
GeneralNames()
Constructs an empty |
|
GeneralNames(byte[] nameBER,
int offset,
int special)
Creates a |
Method Summary |
|
void |
addGeneralName(GeneralName name)
Adds a |
void |
addGeneralName(GeneralName name,
int index)
Adds the new |
clone()
Overrides the default |
|
boolean |
contains(GeneralName name)
Returns |
boolean |
equals(Object obj)
Returns |
int |
getDEREncoding(byte[] encoding,
int offset,
int special)
Places the DER encoding of this
|
int |
getDERLen(int special)
Returns the number of bytes that will be used by the DER encoding of
this |
getGeneralName(int index)
Returns the |
|
getGeneralNames()
Returns the |
|
int |
getNameCount()
Gets the number of elements in this |
static int |
getNextBEROffset(byte[] nameBER,
int offset)
Given nameBER, the BER encoding of a
|
void |
removeGeneralName(int index)
Deletes the |
toString()
Returns a |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public GeneralNames(byte[] nameBER, int offset, int special) throws NameException
GeneralNames
object
and initializes it with the given values.Parameters
nameBER | A | ||
offset | The offset into the nameBER array. | ||
special | The special instructions of
the BER encoding, if
there are any.
The following ASN.1 constants are
possible values for special:
|
Throws
NameException
- If the encoding is invalid.public GeneralNames()
GeneralNames
object.Method Detail |
public void addGeneralName(GeneralName name)
GeneralName
object to this
GeneralNames
object.Parameters
name | The |
public Vector getGeneralNames()
GeneralName
list as a Vector
.
Returns
GeneralName
list as a Vector
.public GeneralName getGeneralName(int index) throws NameException
GeneralName
object at the
specified index.Parameters
index | The index to the
|
Returns
Throws
NameException
- If the specified index is invalid.public void removeGeneralName(int index) throws NameException
GeneralName
object at the specified index.Parameters
index | The index to the |
Throws
NameException
- If the specified index is invalid.public void addGeneralName(GeneralName name, int index) throws NameException
GeneralName
at the specified index.Parameters
name | The new | ||
index | The index to the |
Throws
NameException
- If the specified index is invalid.public String toString()
String
that describes
this GeneralNames
object.
Overrides
toString
in class Object
Returns
String
that describes
this GeneralNames
object.public int getNameCount()
GeneralNames
object.
Returns
GeneralNames
object.public static int getNextBEROffset(byte[] nameBER, int offset) throws NameException
GeneralNames
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 GeneralNames
object.
For example, if the offset is 120 and the
GeneralNames
object's BER encoding is 1819
bytes, then this method will return 1939, the index
immediately following the GeneralNames
object. That is, nameBER[120]
is the first
byte in the encoding of the GeneralNames
object, nameBER[1938]
is the last byte in the
encoding of the GeneralNames
object, and
the next element begins at index 1939.Parameters
nameBER | The BER encoding of this
| ||
offset | The offset into nameBER where the encoding begins. |
Returns
Throws
NameException
- If the method cannot
read the BER encoding.public int getDERLen(int special) throws NameException
GeneralNames
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:
|
Returns
GeneralNames
object.public int getDEREncoding(byte[] encoding, int offset, int special) throws NameException
GeneralNames
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 Extensionpass in the following:
special = (ASN1.CONTEXT_IMPLICIT | 1);If there are no special circumstances, pass in the following:
special = 0The 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 | ||
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:
|
Returns
Throws
NameException
- If the method cannot create
the DER encoding.public boolean equals(Object obj)
true
if this object
and obj contain the same
GeneralNames
object,
returns false
otherwise.Overrides
equals
in class Object
Parameters
obj | An instance of the
|
Returns
boolean
that
indicates whether these objects are equal.public boolean contains(GeneralName name)
true
if this object contains name,
returns false
otherwise.Parameters
name | A |
Returns
boolean
that returns true
if
this object contains name, and
returns false
otherwise.public Object clone() throws CloneNotSupportedException
clone
method
to get a deeper clone.
Returns
GeneralNames
object,
a copy of this object.
Throws
CloneNotSupportedException
- If the cloning operation
is not successful.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |