|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.rsa.certj.cert.extensions.GeneralName
This class is used to define alternative names in a
certificate, especially in SubjectAltName
and IssuerAltName
extensions.
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:
OTHER-NAME
information object class.nameAssigner
component
identifies an authority that assigns unique values of names in the
partyName
component.
See Also
Field Summary |
|
static int |
DIRECTORY_NAME_TYPE
Indicates the |
static int |
DNS_NAME_TYPE
Indicates the |
static int |
EDIPARTY_NAME_TYPE
Indicates the |
static int |
IPADDRESS_NAME_TYPE
Indicates the |
static int |
OTHER_NAME_TYPE
Indicates the OTHER_NAME_TYPE type of |
static int |
REGISTERID_NAME_TYPE
Indicates the |
static int |
RFC822_NAME_TYPE
Indicates the |
static int |
URL_NAME_TYPE
Indicates the |
static int |
X400ADDRESS_NAME_TYPE
Indicates the |
Constructor Summary |
|
GeneralName()
Constructs an empty |
|
GeneralName(byte[] nameBER,
int offset,
int special)
Creates a |
Method Summary |
|
clone()
Overrides the default |
|
boolean |
equals(Object obj)
Returns |
int |
getDEREncoding(byte[] encoding,
int offset,
int special)
Places the DER encoding of the
|
int |
getDERLen(int special)
Returns the number of bytes that will be used by the DER encoding
of this |
getGeneralName()
Gets the |
|
int |
getGeneralNameType()
Gets the |
static int |
getNextBEROffset(byte[] nameBER,
int offset)
Given nameBER, the BER encoding of a
|
void |
setGeneralName(Object name,
int type)
Sets this object with the general name given in name and type. |
toString()
Gets a |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int OTHER_NAME_TYPE
GeneralName
.public static final int RFC822_NAME_TYPE
RFC822_NAME_TYPE
type of GeneralName
.public static final int DNS_NAME_TYPE
DNS_NAME_TYPE
type of GeneralName
.public static final int X400ADDRESS_NAME_TYPE
X400ADDRESS_NAME_TYPE
type of GeneralName
.public static final int DIRECTORY_NAME_TYPE
DIRECTORY_NAME_TYPE
type of GeneralName
.public static final int EDIPARTY_NAME_TYPE
EDIPARTY_NAME_TYPE
type of GeneralName
.public static final int URL_NAME_TYPE
URL_NAME_TYPE
type of GeneralName
.public static final int IPADDRESS_NAME_TYPE
IPADDRESS_NAME_TYPE
type of GeneralName
.public static final int REGISTERID_NAME_TYPE
REGISTERID_NAME_TYPE
type of GeneralName
.Constructor Detail |
public GeneralName(byte[] nameBER, int offset, int special) throws NameException
GeneralName
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.
The following ASN.1 constants are
possible values for special:
|
Throws
NameException
- If the BER encoding is invalid.public GeneralName()
GeneralName
object..Method Detail |
public void setGeneralName(Object name, int type) throws NameException
Parameters
name | An object that contains the general name.
(For | ||
type | The type of this |
Throws
NameException
- If name
is of the wrong type.public Object getGeneralName()
GeneralName
value.
Returns
GeneralName
value. (iPAddress
and registeredID
values will return a
byte
array.)public int getGeneralNameType()
GeneralName
type.
Returns
GeneralName
object (one of the static fields previously defined in this class).public String toString()
String
representation
of the GeneralName
object.
Overrides
toString
in class Object
Returns
String
that
describes this GeneralName
object.public static int getNextBEROffset(byte[] nameBER, int offset) throws NameException
GeneralName
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 GeneralName
object.
For example, if the offset is 120 and the
GeneralName
object's BER encoding is 1819
bytes, then this method will return 1939, the index
immediately following the GeneralName
object. That is, nameBER[120]
is the first
byte in the encoding of the GeneralName
object, nameBER[1938]
is the last byte in the
encoding of the GeneralName
object, and
the next element begins at index 1939.Parameters
nameBER | The BER encoding of
a | ||
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
GeneralName
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.
The following ASN.1 constants are
possible values for special:
|
Returns
public int getDEREncoding(byte[] encoding, int offset, int special) throws NameException
GeneralName
object into
encoding, beginning at
offset. To determine how
long the encoding will be, call
getDERLen
. If this object is
not yet set with values, this method places
nothing into the array and
returns 0. To indicate that
the DER encoding should follow any special
instructions, use the special argument.
For instance, 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 | A | ||
offset | The offset into encoding where to begin writing. | ||
special | The special DER circumstances of the encoding, if there are any. |
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 GeneralName
, returns
false
otherwise.Overrides
equals
in class Object
Parameters
obj | An instance of the
|
Returns
boolean
indicating whether
these objects are equal.public Object clone() throws CloneNotSupportedException
clone
method to get a deeper clone.
Returns
GeneralName
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 |