issrg.ac.attributes
Class BasicAttConstraint

java.lang.Object
  extended by issrg.ac.Extension
      extended by issrg.ac.attributes.BasicAttConstraint
All Implemented Interfaces:
java.lang.Cloneable

public class BasicAttConstraint
extends Extension

Author:
anhnt

Field Summary
static java.lang.String BASIC_ATT_CONSTRAINT_OID
          The string stores the standard OID for the basicAttConstraints: 2.5.29.41
 
Fields inherited from class issrg.ac.Extension
critical, extnID, Null, theObject
 
Constructor Summary
BasicAttConstraint(BasicAttConstraint e)
          Constructor for the class from an existing basicAttConstraints object
BasicAttConstraint(boolean critical)
          This constructor builds a BasicAttributeConstraint extension with no limit on Delegation depth.
BasicAttConstraint(boolean critical, int depth)
          This constructor builds a BasicAttributeConstraint extension with the specified limit on Delegation depth.
 
Method Summary
 java.lang.Object clone()
           
 void decodeValue(ASN1Object ao)
          This method decodes an ASN1Object to get an extension value for the BasicAttConstraint object.
 ASN1Object encodeValue()
          This method encodes the extension value of this extension to an ASN1Object.
 java.lang.String extensionValueToString(java.lang.String ident)
          This method returns a string that represents the object
 int getDepth()
          This method returns the delegation depth of the basicAttConstraints object
static void registerMe()
          This method registers this extension as an extension with a specific OID.
 void setDepth(int d)
          This method set the delegation depth for the object.
 
Methods inherited from class issrg.ac.Extension
decode, getExtensionOID, getExtensionValue, isCritical, setCritical, setExtensionOID, setExtensionValue, toASN1Object, toString, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

BASIC_ATT_CONSTRAINT_OID

public static final java.lang.String BASIC_ATT_CONSTRAINT_OID
The string stores the standard OID for the basicAttConstraints: 2.5.29.41

See Also:
Constant Field Values
Constructor Detail

BasicAttConstraint

public BasicAttConstraint(BasicAttConstraint e)
                   throws CodingException
Constructor for the class from an existing basicAttConstraints object

Parameters:
e - is a basicAttConstraint object
Throws:
CodingException

BasicAttConstraint

public BasicAttConstraint(boolean critical)
This constructor builds a BasicAttributeConstraint extension with no limit on Delegation depth. This is the same as calling BasicAttConstraint(critical, null).

Parameters:
critical - is a boolean value that specifies the critical of the object

BasicAttConstraint

public BasicAttConstraint(boolean critical,
                          int depth)
This constructor builds a BasicAttributeConstraint extension with the specified limit on Delegation depth. If delegation depth is null or is a negative number, an unlimited delegation is assumed.

Parameters:
critical - - the criticality flag; if true, the extension is marked critical
depth - - the depth of delegation
See Also:
for explanation of depth values
Method Detail

registerMe

public static void registerMe()
This method registers this extension as an extension with a specific OID. After it has been registered, Extensions can recognise the extension with this OID.


getDepth

public int getDepth()
This method returns the delegation depth of the basicAttConstraints object

Returns:
an integer that represents the delegation depth of the object

setDepth

public void setDepth(int d)
This method set the delegation depth for the object. The mere presence of this extension means that delegation is allowed at least one level down, so the delegation depth number tells how many more levels can exist below the first level.

Parameters:
d - is an integer. It is used for setting the delegation depth for the object If negative, no limit on the delegation depth will be set; if zero, delegation cannot continue after the first level of delegates (can delegate one level down, and no further - the delegates cannot have BasicAttConstraint extension); if any positive number, delegation chain can be that many steps long after the first level of delegates (the first level of delegates can delegate that many levels down).

encodeValue

public ASN1Object encodeValue()
                       throws CodingException
This method encodes the extension value of this extension to an ASN1Object.

Overrides:
encodeValue in class Extension
Returns:
an ASN1Object
Throws:
CodingException

clone

public java.lang.Object clone()
Overrides:
clone in class Extension

decodeValue

public void decodeValue(ASN1Object ao)
                 throws CodingException
This method decodes an ASN1Object to get an extension value for the BasicAttConstraint object.

Overrides:
decodeValue in class Extension
Parameters:
ao - is the ASN1Object.
Throws:
CodingException

extensionValueToString

public java.lang.String extensionValueToString(java.lang.String ident)
This method returns a string that represents the object

Overrides:
extensionValueToString in class Extension
Parameters:
ident - is a string that used for seperating the critical value and the delegation depth of the object