public class OldBasicConstraints extends BasicConstraints
OldBasicConstraints Extension.
The OldBasicConstraints extension is obsolete, and has been replaced
by the BasicConstraints extension. It is provided here for backward
compatibility with older certificates only.
The OldBasicConstraints OID is "2.5.29.10".
The ASN.1 definition of the OldBasicConstraints extension is specified
as follows:
OldBasicConstraints ::= SEQUENCE {
subjectType BIT_STRING,
pathLenConstraint INTEGER (0..MAX) OPTIONAL }
The subjectType field supports two meaningful bits. Bit 0 indicates a CA certificate,
and bit 1 indicates an end-entity certificate. Exactly one of these bits must be set. Other
patterns are not supported.
The pathLenConstraint field is identical in structure and meaning to the
pathLenConstraint field in the BasicConstraints extension.
Please refer to the BasicConstraints extension for usage details.
This class provides several methods for getting (but not setting) the component values of an
OldBasicConstraints extension object.
V3Extension,
X509Certificate,
BasicConstraints| Modifier and Type | Field and Description |
|---|---|
static ObjectID |
oid |
critical| Constructor and Description |
|---|
OldBasicConstraints()
Default constructor.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
ca()
Returns
true if the subject of the certificate holding this
BasicConstraints extension is a CA. |
ObjectID |
getObjectID()
Returns the object ID of this
OldBasicConstraints extension |
int |
getPathLenConstraint()
Returns the
pathLenConstraint value of this OldBasicConstraints
extension specifying the maximum number of CA certificates that may follow the
certificate in a certification path. |
int |
hashCode()
Returns a hashcode for this identity.
|
void |
init(ASN1Object seq)
Inits this
OldBasicConstraints implementation with an ASN1Object
representing the value of this extension. |
ASN1Object |
toASN1Object()
Stub function to meet V3Extension criteria.
|
java.lang.String |
toString()
Returns a string that represents the contents of this
OldBasicConstraints extension. |
setCa, setPathLenConstraintgetName, isCritical, setCriticalpublic static final ObjectID oid
public OldBasicConstraints()
The OldBasicConstraints extension is obsolete and has been replaced
by the BasicConstraints extension in the current X.509 specification.
Generating a new OldBasicConstraints extension is not supported.
This class is provided for backward compatibility with existing certificates only.
public ObjectID getObjectID()
OldBasicConstraints extensiongetObjectID in class BasicConstraintspublic void init(ASN1Object seq) throws X509ExtensionException
OldBasicConstraints implementation with an ASN1Object
representing the value of this extension.
The ASN1Object is the extensionValue from ASN.1 type "Extension" representing
the subjectType and (optional) pathLenConstraint values
of this extension.
init in class BasicConstraintsseq - the extensionValue as an ASN1ObjectX509ExtensionException - if the extension could not be parsedpublic ASN1Object toASN1Object()
toASN1Object in class BasicConstraintsBasicConstraints as ASN1Objectpublic boolean ca()
true if the subject of the certificate holding this
BasicConstraints extension is a CA.ca in class BasicConstraintstrue if the subject is a CA, false if not.BasicConstraints.setCa(boolean)public int getPathLenConstraint()
pathLenConstraint value of this OldBasicConstraints
extension specifying the maximum number of CA certificates that may follow the
certificate in a certification path.
The pathLenConstraint field is meaningful only if the cA bit in
the subjectType field is set.
If cA bit is set and pathLenConstraint is set, this method returns
the maximum number of CA certificates that may follow the certificate in a certification path.
If cA bit is set and pathLenConstraint is not specified, this method
returns -1 indicating that there is no limit to the allowed length of the certification path.
getPathLenConstraint in class BasicConstraintspathLenConstraint value.BasicConstraints.setPathLenConstraint(int)public int hashCode()
hashCode in class BasicConstraintspublic java.lang.String toString()
OldBasicConstraints extension.toString in class BasicConstraints