|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.rsa.certj.cert.extensions.GeneralSubtrees
This class is used in the NameConstraints
class.
GeneralSubtrees ::= SEQUENCE SIZE (1..MAX) OF GeneralSubtree GeneralSubtree ::= SEQUENCE { base GeneralName, minimum [0] BaseDistance DEFAULT 0, maximum [1] BaseDistance OPTIONAL } BaseDistance ::= INTEGER (0..MAX) |
GeneralSubtree
component specifies
one or more naming subtrees. Each subtree isdefined
by the name
of the root of the subtree (base
) and,
optionally, within that subtree, an area that is
bounded by upper or lower levels.
Visually, the subtree would be represented with the
root at the top and the branches below. Therefore,
the minimum
field specifies the upper
boundary of the area within the subtree. All names
whose final name component is above the level
specified are not contained within the area. A value
of minimum
equal to zero (the default)
corresponds to the base
, that is, the top
node of the subtree. If minimum
is set to
one, then the naming subtree excludes the base node
but includes subordinate nodes.
The maximum
field specifies the lower
boundary of the area within the subtree. All names
whose final component is below the level specified are not
contained within the area. A value of
maximum
equal to zero corresponds to the
base
, that is, the top node of the
subtree. An absent maximum
component
indicates that no lower limit is imposed on the
area within the subtree. If maximum
is
set to one, then the naming subtree excludes all nodes
except the subtree base and its immediate subordinates.
For example, a name constraint for Internet mail
addresses may specify a particular mailbox, all
addresses at a particular host, or all mailboxes in a
domain. To indicate a particular mailbox, the
constraint is the complete mail address. For example,
root@xyz.com
indicates the root mailbox
on the host xyz.com
. To indicate all Internet
mail addresses on a particular host, the
constraint is specified as the host name. For example,
the constraint xyz.com
is satisfied by
any mail address at the host xyz.com
. To
specify any address within a domain, the constraint is
specified with a leading period. For example,
xyz.com
indicates all the Internet mail
addresses in the domain xyz.com
.
Copyright © RSA Security Inc., 1998-2001. All rights reserved.
See Also
Constructor Summary |
|
GeneralSubtrees()
Constructs an empty |
|
GeneralSubtrees(byte[] valueBER,
int offset,
int special)
Constructs a |
Method Summary |
|
void |
addSubtree(GeneralName base,
int minimum,
int maximum)
Adds a general subtree to this object. |
clone()
Overrides the default |
|
boolean |
equals(Object obj)
Returns |
getBase(int index)
Gets the |
|
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 |
int |
getMaximum(int index)
Gets the |
int |
getMinimum(int index)
Gets the |
static int |
getNextBEROffset(byte[] valueBER,
int offset)
Given valueBER, the BER encoding of a
|
int |
getSubtreeCount()
Gets the number of subtrees in this object. |
toString()
Returns a |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public GeneralSubtrees()
GeneralSubtrees
object.public GeneralSubtrees(byte[] valueBER, int offset, int special) throws NameException
GeneralSubtrees
object and
initializes it with the given values.Parameters
valueBER | A | ||
offset | The offset into the valueBER 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.Method Detail |
public void addSubtree(GeneralName base, int minimum, int maximum)
Parameters
base | The | ||
minimum | The | ||
maximum | The |
public GeneralName getBase(int index) throws NameException
base
value of the specified subtree.Parameters
index | The index to the specified general subtree. |
Returns
Throws
NameException
- If the specified index is invalid.public int getMinimum(int index) throws NameException
minimum
value of the specified general subtree.Parameters
index | The index to the specified general subtree. |
Returns
Throws
NameException
- If the specified index is invalid.public int getMaximum(int index) throws NameException
maximum
value of the specified general subtree.Parameters
index | The index to the specified general subtree. |
Returns
Throws
NameException
- If the specified index is invalid.public int getSubtreeCount()
Returns
public String toString()
String
that describes this
GeneralSubtrees
object.
Overrides
toString
in class Object
Returns
String
that describes this
GeneralSubtrees
object.public static int getNextBEROffset(byte[] valueBER, int offset) throws NameException
GeneralSubtrees
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 GeneralSubtrees
object.
For example, if the offset is 120 and the
GeneralSubtrees
object's BER encoding is 1819
bytes, then this method will return 1939, the index
immediately following the GeneralSubtrees
object. That is, nameBER[120]
is the first
byte in the encoding of the GeneralSubtrees
object, nameBER[1938]
is the last byte in the
encoding of the GeneralSubtrees
object, and
the next element begins at index 1939.Parameters
nameBER | The BER encoding of this
| ||
offset | The offset into valueBER where the encoding begins. |
Returns
Throws
NameException
- If the method cannot
read the BER encoding.public int getDERLen(int special) throws NameException
GeneralSubtrees
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
GeneralSubtrees
object.
Throws
NameException
- If the method cannot get
the length of the DER encoding.public int getDEREncoding(byte[] encoding, int offset, int special) throws NameException
GeneralSubtrees
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
GeneralSubtrees
,
returns false
otherwise.Overrides
equals
in class Object
Parameters
obj | An instance of the |
Returns
boolean
that indicates whether
these objects are equal.public Object clone() throws CloneNotSupportedException
clone
method
to get a deeper clone.
Returns
GeneralSubtrees
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 |