codec.x509.extensions
Class BasicConstraintsExtension

java.lang.Object
  extended by java.util.AbstractCollection<E>
      extended by java.util.AbstractList<E>
          extended by java.util.ArrayList
              extended by codec.asn1.ASN1AbstractCollection
                  extended by codec.asn1.ASN1Sequence
                      extended by codec.x509.X509Extension
                          extended by codec.x509.extensions.BasicConstraintsExtension
All Implemented Interfaces:
ASN1Collection, ASN1Type, Serializable, Cloneable, Iterable, X509Extension, Collection, List, RandomAccess

public class BasicConstraintsExtension
extends X509Extension

  id-ce-extBasicConstraints OBJECT IDENTIFIER ::= {id-ce 19}
  BasicConstraintsSyntax ::= SEQUENCE {

        cA              BOOLEAN DEFAULT FALSE,
                pathLenConstraint (0..MAX) OPTIONAL
        }
 
        id-ce OBJECT IDENTIFIER  ::=  {joint-iso-ccitt(2) ds(5) 29}
 
 

Author:
mal
See Also:
Serialized Form

Field Summary
protected  ASN1Sequence basicConstraintsSyntax
           
protected  ASN1Boolean cA
           
protected static ASN1ObjectIdentifier id_ce_basicConstraints
           
protected  ASN1Integer pathLenConstraints
           
 
Fields inherited from class codec.x509.X509Extension
critical, extnID, extnValue
 
Fields inherited from class java.util.AbstractList
modCount
 
Constructor Summary
  BasicConstraintsExtension()
           
private BasicConstraintsExtension(ASN1ObjectIdentifier theoid, boolean crit, ASN1Type val)
          Constructor for BasicConstraintsExtension is made private to prevent access.
  BasicConstraintsExtension(boolean crit)
          Constructor for BasicConstraintsExtension.
  BasicConstraintsExtension(boolean cA, boolean crit)
           
  BasicConstraintsExtension(boolean cA, int pathLenConstraints, boolean crit)
           
  BasicConstraintsExtension(byte[] ext)
          Constructor for BasicConstraintsExtension.
 
Method Summary
 void decode(Decoder dec)
          Reads this collection from the given decoder.
 int getPathLenConstraints()
          Returns the pathLenConstraints.
 boolean isCA()
          Returns the cA.
 void setCA(boolean cA)
          Sets the cA.
 void setPathLenConstraints(int pathLenConstraints)
          Sets the pathLenConstraints.
 String toString(String offset)
          Returns a human-readable String representation of this extension with an offset String.
 
Methods inherited from class codec.x509.X509Extension
getCriticalExtensionOIDs, getEncoded, getExtensionValue, getNonCriticalExtensionOIDs, getOID, getValue, hasUnsupportedCriticalExtension, isCritical, setCritical, setOID, setValue, toString
 
Methods inherited from class codec.asn1.ASN1Sequence
getTag
 
Methods inherited from class codec.asn1.ASN1AbstractCollection
checkConstraints, encode, getCollection, getConstraint, getTagClass, isExplicit, isOptional, isType, setConstraint, setExplicit, setOptional
 
Methods inherited from class java.util.ArrayList
add, add, addAll, addAll, clear, clone, contains, ensureCapacity, get, indexOf, isEmpty, lastIndexOf, remove, remove, removeRange, set, size, toArray, toArray, trimToSize
 
Methods inherited from class java.util.AbstractList
equals, hashCode, iterator, listIterator, listIterator, subList
 
Methods inherited from class java.util.AbstractCollection
containsAll, removeAll, retainAll
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Collection
add, addAll, clear, contains, containsAll, equals, hashCode, isEmpty, iterator, remove, removeAll, retainAll, size, toArray, toArray
 
Methods inherited from interface java.util.List
containsAll, equals, hashCode, iterator, listIterator, listIterator, removeAll, retainAll, subList
 

Field Detail

id_ce_basicConstraints

protected static final ASN1ObjectIdentifier id_ce_basicConstraints

cA

protected ASN1Boolean cA

pathLenConstraints

protected ASN1Integer pathLenConstraints

basicConstraintsSyntax

protected ASN1Sequence basicConstraintsSyntax
Constructor Detail

BasicConstraintsExtension

public BasicConstraintsExtension()
                          throws Exception
Throws:
Exception

BasicConstraintsExtension

public BasicConstraintsExtension(boolean crit)
                          throws Exception
Constructor for BasicConstraintsExtension.

Throws:
Exception

BasicConstraintsExtension

public BasicConstraintsExtension(boolean cA,
                                 boolean crit)
                          throws Exception
Throws:
Exception

BasicConstraintsExtension

public BasicConstraintsExtension(boolean cA,
                                 int pathLenConstraints,
                                 boolean crit)
                          throws Exception
Throws:
Exception

BasicConstraintsExtension

public BasicConstraintsExtension(byte[] ext)
                          throws ASN1Exception,
                                 IOException
Constructor for BasicConstraintsExtension.

Parameters:
ext -
Throws:
ASN1Exception
IOException

BasicConstraintsExtension

private BasicConstraintsExtension(ASN1ObjectIdentifier theoid,
                                  boolean crit,
                                  ASN1Type val)
                           throws Exception
Constructor for BasicConstraintsExtension is made private to prevent access.

Parameters:
theoid -
crit -
val -
Throws:
Exception
Method Detail

isCA

public boolean isCA()
Returns the cA.

Returns:
ASN1Boolean

getPathLenConstraints

public int getPathLenConstraints()
Returns the pathLenConstraints.

Returns:
ASN1Integer

setCA

public void setCA(boolean cA)
Sets the cA.

Parameters:
cA - The cA to set

setPathLenConstraints

public void setPathLenConstraints(int pathLenConstraints)
                           throws Exception
Sets the pathLenConstraints.

Parameters:
pathLenConstraints - The pathLenConstraints to set
Throws:
Exception

decode

public void decode(Decoder dec)
            throws ASN1Exception,
                   IOException
Description copied from class: ASN1AbstractCollection
Reads this collection from the given decoder. This type is initialised with the decoded data. The components of the decoded collection must match the components of this collection. If they do then the components are also initialised with the decoded values. Otherwise an exception is thrown.

Specified by:
decode in interface ASN1Type
Overrides:
decode in class ASN1AbstractCollection
Throws:
ASN1Exception
IOException

toString

public String toString(String offset)
Description copied from class: X509Extension
Returns a human-readable String representation of this extension with an offset String.

Overrides:
toString in class X509Extension
Parameters:
offset - String that will be put before each line of output


Copyright © Fraunhofer Gesellschaft. All Rights Reserved.