Class CRLDistributionPointsExtension
java.lang.Object
org.mozilla.jss.netscape.security.x509.Extension
org.mozilla.jss.netscape.security.x509.CRLDistributionPointsExtension
- All Implemented Interfaces:
Serializable,CertAttrSet
An extension that tells applications where to find the CRL for
this certificate.
cRLDistributionPoints ::= SEQUENCE SIZE (1..MAX) OF DistributionPoint
DistributionPoint ::= SEQUENCE {
distributionPoint [0] DistributionPointName OPTIONAL,
reasons [1] ReasonFlags OPTIONAL,
cRLIssuer [2] GeneralNames OPTIONAL }
DistributionPointName ::= CHOICE {
fullName [0] GeneralNames,
nameRelativeToCRLIssuer [1] RelativeDistinguishedName }
ReasonFlags ::= BIT STRING {
unused (0),
keyCompromise (1),
cACompromise (2),
affiliationChanged (3),
superseded (4),
cessationOfOperation (5),
certificateHold (6) }
- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classRepresents a reason that a cert may be revoked. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]private SEQUENCEprivate static final org.slf4j.Loggerstatic final Stringstatic final StringThe Object Identifier for this extension.private static final longFields inherited from class org.mozilla.jss.netscape.security.x509.Extension
critical, extensionId, extensionValue -
Constructor Summary
ConstructorsConstructorDescriptionCRLDistributionPointsExtension(Boolean critical, Object value) This constructor is called by the CertificateExtensions class to decode an extension whose OID indicates it is a CRLDistributionsPoints extension.Creates a new CRLDistributionPoints extension, with the given distribution point as the first element. -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds an additional distribution point to the end of the sequence.voiddecode(InputStream in) Decodes the attribute in the input stream.voidDeletes an attribute value from this CertAttrSet.voidencode(OutputStream ostream) DER-encodes this extension to the given OutputStream.voidencode(DerOutputStream out) Encodes this extension to the given DerOutputStream.voidShould be called if any change is made to this data structure so that the cached DER encoding can be discarded.Gets an attribute value for this CertAttrSet.Returns an enumeration of the names of the attributes existing within this attribute.getName()Returns the name (identifier) of this CertAttrSet.intReturns the number of distribution points in the sequence.getPointAt(int index) Returns the DistributionPoint at the given index in the sequence.static voidTest driver.voidSets an attribute value within this CertAttrSet.voidsetCritical(boolean critical) Sets the criticality of this extension.toString()Returns the Extension in user readable form.Methods inherited from class org.mozilla.jss.netscape.security.x509.Extension
clearValue, getExtensionId, getExtensionValue, isCritical, setExtensionId, setExtensionValue
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
logger
private static final org.slf4j.Logger logger -
distributionPoints
-
cachedEncoding
private byte[] cachedEncoding -
OID
The Object Identifier for this extension.- See Also:
-
NAME
- See Also:
-
-
Constructor Details
-
CRLDistributionPointsExtension
This constructor is called by the CertificateExtensions class to decode an extension whose OID indicates it is a CRLDistributionsPoints extension. -
CRLDistributionPointsExtension
Creates a new CRLDistributionPoints extension, with the given distribution point as the first element.
-
-
Method Details
-
addPoint
Adds an additional distribution point to the end of the sequence. -
getNumPoints
public int getNumPoints()Returns the number of distribution points in the sequence. -
getPointAt
Returns the DistributionPoint at the given index in the sequence. -
setCritical
public void setCritical(boolean critical) Sets the criticality of this extension. PKIX dictates that this extension SHOULD NOT be critical, so applications can make it critical if they have a very good reason. By default, the extension is not critical.- Overrides:
setCriticalin classExtension
-
encode
Encodes this extension to the given DerOutputStream. This method re-encodes each time it is called, so it is not very efficient.- Overrides:
encodein classExtension- Parameters:
out- the DerOutputStream to write the extension to.- Throws:
IOException- on encoding errors
-
flushCachedEncoding
public void flushCachedEncoding()Should be called if any change is made to this data structure so that the cached DER encoding can be discarded. -
toString
Description copied from class:ExtensionReturns the Extension in user readable form.- Specified by:
toStringin interfaceCertAttrSet- Overrides:
toStringin classExtension- Returns:
- value of this certificate attribute in printable form.
-
encode
DER-encodes this extension to the given OutputStream.- Specified by:
encodein interfaceCertAttrSet- Parameters:
ostream- the OutputStream to encode the attribute to.- Throws:
CertificateException- on encoding or validity errors.IOException- on other errors.
-
decode
Description copied from interface:CertAttrSetDecodes the attribute in the input stream.- Specified by:
decodein interfaceCertAttrSet- Parameters:
in- the InputStream to read the encoded attribute from.- Throws:
CertificateException- on decoding or validity errors.IOException- on other errors.
-
set
Description copied from interface:CertAttrSetSets an attribute value within this CertAttrSet.- Specified by:
setin interfaceCertAttrSet- Parameters:
name- the name of the attribute (e.g. "x509.info.key")obj- the attribute object.- Throws:
CertificateException- on attribute handling errors.IOException- on other errors.
-
get
Description copied from interface:CertAttrSetGets an attribute value for this CertAttrSet.- Specified by:
getin interfaceCertAttrSet- Parameters:
name- the name of the attribute to return.- Returns:
- attribute value
- Throws:
CertificateException- on attribute handling errors.IOException- on other errors.
-
delete
Description copied from interface:CertAttrSetDeletes an attribute value from this CertAttrSet.- Specified by:
deletein interfaceCertAttrSet- Parameters:
name- the name of the attribute to delete.- Throws:
CertificateException- on attribute handling errors.IOException- on other errors.
-
getAttributeNames
Description copied from interface:CertAttrSetReturns an enumeration of the names of the attributes existing within this attribute.- Specified by:
getAttributeNamesin interfaceCertAttrSet- Returns:
- an enumeration of the attribute names.
-
getName
Description copied from interface:CertAttrSetReturns the name (identifier) of this CertAttrSet.- Specified by:
getNamein interfaceCertAttrSet- Returns:
- the name of this CertAttrSet.
-
main
Test driver.
-