java.lang.Object | ||
↳ | sun.security.x509.Extension | |
↳ | sun.security.x509.NameConstraintsExtension |
This class defines the Name Constraints Extension.
The name constraints extension provides permitted and excluded subtrees that place restrictions on names that may be included within a certificate issued by a given CA. Restrictions may apply to the subject distinguished name or subject alternative names. Any name matching a restriction in the excluded subtrees field is invalid regardless of information appearing in the permitted subtrees.
The ASN.1 syntax for this is:
NameConstraints ::= SEQUENCE { permittedSubtrees [0] GeneralSubtrees OPTIONAL, excludedSubtrees [1] GeneralSubtrees OPTIONAL } GeneralSubtrees ::= SEQUENCE SIZE (1..MAX) OF GeneralSubtree
Constants | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
String | EXCLUDED_SUBTREES | ||||||||||
String | IDENT | Identifier for this attribute, to be used with the get, set, delete methods of Certificate, x509 type. | |||||||||
String | NAME | Attribute names. | |||||||||
String | PERMITTED_SUBTREES |
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
The default constructor for this class.
| |||||||||||
Create the extension from the passed DER encoded value.
|
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Clone all objects that may be modified during certificate validation.
| |||||||||||
Delete the attribute value.
| |||||||||||
Write the extension to the OutputStream.
| |||||||||||
Get the attribute value.
| |||||||||||
Return an enumeration of names of attributes existing within this
attribute.
| |||||||||||
Return the name of this attribute.
| |||||||||||
Merge additional name constraints with existing ones.
| |||||||||||
Set the attribute value.
| |||||||||||
Return the printable string.
| |||||||||||
check whether a name conforms to these NameConstraints.
| |||||||||||
check whether a certificate conforms to these NameConstraints.
| |||||||||||
Perform the RFC 822 special case check.
|
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() | |||||||||||
![]() |
Identifier for this attribute, to be used with the get, set, delete methods of Certificate, x509 type.
The default constructor for this class. Both parameters are optional and can be set to null. The extension criticality is set to true.
permitted | the permitted GeneralSubtrees (null for optional). |
---|---|
excluded | the excluded GeneralSubtrees (null for optional). |
IOException |
---|
Create the extension from the passed DER encoded value.
critical | true if the extension is to be treated as critical. |
---|---|
value | an array of DER encoded bytes of the actual value. |
ClassCastException | if value is not an array of bytes |
---|---|
IOException | on error. |
Clone all objects that may be modified during certificate validation.
Write the extension to the OutputStream.
out | the OutputStream to write the extension to. |
---|
IOException | on encoding errors. |
---|
Return an enumeration of names of attributes existing within this attribute.
Merge additional name constraints with existing ones. This function is used in certification path processing to accumulate name constraints from successive certificates in the path. Note that NameConstraints can never be expanded by a merge, just remain constant or become more limiting.
IETF RFC2459 specifies the processing of Name Constraints as follows:
(j) If permittedSubtrees is present in the certificate, set the constrained subtrees state variable to the intersection of its previous value and the value indicated in the extension field.
(k) If excludedSubtrees is present in the certificate, set the excluded subtrees state variable to the union of its previous value and the value indicated in the extension field.
newConstraints | additional NameConstraints to be applied |
---|
IOException | on error |
---|
Set the attribute value.
name | the name of the attribute (e.g. "x509.info.key") |
---|---|
obj | the attribute object. |
IOException |
---|
Return the printable string.
check whether a name conforms to these NameConstraints. This involves verifying that the name is consistent with the permitted and excluded subtrees variables.
name | GeneralNameInterface name to be verified |
---|
IOException | on error |
---|
check whether a certificate conforms to these NameConstraints. This involves verifying that the subject name and subjectAltName extension (critical or noncritical) is consistent with the permitted subtrees state variables. Also verify that the subject name and subjectAltName extension (critical or noncritical) is consistent with the excluded subtrees state variables.
cert | X509Certificate to be verified |
---|
IOException | on error |
---|
Perform the RFC 822 special case check. We have a certificate that does not contain any subject alternative names. Check that any EMAILADDRESS attributes in its subject name conform to these NameConstraints.
subject | the certificate's subject name |
---|
IOException | on error |
---|