Package com.unboundid.util.ssl.cert
Class BasicConstraintsExtension
java.lang.Object
com.unboundid.util.ssl.cert.X509CertificateExtension
com.unboundid.util.ssl.cert.BasicConstraintsExtension
- All Implemented Interfaces:
Serializable
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class BasicConstraintsExtension
extends X509CertificateExtension
This class provides an implementation of the basic constraints X.509
certificate extension as described in
RFC 5280 section 4.2.1.9.
This can be used to indicate whether a certificate is a certification
authority (CA), and the maximum depth of certification paths that include
this certificate.
The OID for this extension is 2.5.29.19 and the value has the following encoding:
The OID for this extension is 2.5.29.19 and the value has the following encoding:
BasicConstraints ::= SEQUENCE {
cA BOOLEAN DEFAULT FALSE,
pathLenConstraint INTEGER (0..MAX) OPTIONAL }
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final OIDThe OID (2.5.29.19) for basic constraints extensions. -
Method Summary
Modifier and TypeMethodDescriptionRetrieves the name for this extension.Retrieves the path length constraint for the associated certificate, if defined.booleanisCA()Indicates whether the associated certificate is a certification authority (that is, can be used to sign other certificates).voidtoString(StringBuilder buffer) Appends a string representation of this certificate extension to the provided buffer.Methods inherited from class com.unboundid.util.ssl.cert.X509CertificateExtension
getOID, getValue, isCritical, toString
-
Field Details
-
BASIC_CONSTRAINTS_OID
The OID (2.5.29.19) for basic constraints extensions.
-
-
Method Details
-
isCA
Indicates whether the associated certificate is a certification authority (that is, can be used to sign other certificates).- Returns:
trueif the associated certificate is a certification authority, orfalseif not.
-
getPathLengthConstraint
Retrieves the path length constraint for the associated certificate, if defined. IfisCA()returnstrueand this method returns a non-nullvalue, then any certificate chain that includes the associated certificate should not be trusted if the chain contains more than this number of certificates.- Returns:
- The path length constraint for the associated certificate, or
nullif no path length constraint is defined.
-
getExtensionName
Retrieves the name for this extension.- Overrides:
getExtensionNamein classX509CertificateExtension- Returns:
- The name for this extension.
-
toString
Appends a string representation of this certificate extension to the provided buffer.- Overrides:
toStringin classX509CertificateExtension- Parameters:
buffer- The buffer to which the information should be appended.
-