Class FreshestCRLExtension
- java.lang.Object
-
- org.mozilla.jss.netscape.security.x509.Extension
-
- org.mozilla.jss.netscape.security.x509.FreshestCRLExtension
-
- All Implemented Interfaces:
java.io.Serializable,CertAttrSet
public class FreshestCRLExtension extends Extension implements CertAttrSet
An extension that tells applications where to find the latest (freshest) delta CRL for this certificate or full CRL.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:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFreshestCRLExtension.ReasonRepresents a reason that a cert may be revoked.
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringNAMEstatic java.lang.StringOID-
Fields inherited from class org.mozilla.jss.netscape.security.x509.Extension
critical, extensionId, extensionValue
-
-
Constructor Summary
Constructors Constructor Description FreshestCRLExtension()FreshestCRLExtension(java.lang.Boolean critical, java.lang.Object value)This constructor is called by the CertificateExtensions class to decode an extension whose OID indicates it is a CRLDistributionsPoints extension.FreshestCRLExtension(CRLDistributionPoint dp)Creates a new FreshestCRL extension, with the given distribution point as the first element.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddPoint(CRLDistributionPoint dp)Adds an additional distribution point to the end of the sequence.voiddecode(java.io.InputStream in)Decodes the attribute in the input stream.voiddelete(java.lang.String name)Deletes an attribute value from this CertAttrSet.voidencode(java.io.OutputStream ostream)DER-encodes this extension to the given OutputStream.voidencode(DerOutputStream out)Encodes this extension to the given DerOutputStream.voidflushCachedEncoding()Should be called if any change is made to this data structure so that the cached DER encoding can be discarded.java.lang.Objectget(java.lang.String name)Gets an attribute value for this CertAttrSet.java.util.Enumeration<java.lang.String>getAttributeNames()Returns an enumeration of the names of the attributes existing within this attribute.java.lang.StringgetName()Returns the name (identifier) of this CertAttrSet.intgetNumPoints()Returns the number of distribution points in the sequence.CRLDistributionPointgetPointAt(int index)Returns the DistributionPoint at the given index in the sequence.static voidmain(java.lang.String[] args)Test driver.voidset(java.lang.String name, java.lang.Object obj)Sets an attribute value within this CertAttrSet.voidsetCritical(boolean critical)Sets the criticality of this extension.java.lang.StringtoString()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 Detail
-
NAME
public static final java.lang.String NAME
- See Also:
- Constant Field Values
-
OID
public static final java.lang.String OID
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
FreshestCRLExtension
public FreshestCRLExtension()
-
FreshestCRLExtension
public FreshestCRLExtension(java.lang.Boolean critical, java.lang.Object value)This constructor is called by the CertificateExtensions class to decode an extension whose OID indicates it is a CRLDistributionsPoints extension.
-
FreshestCRLExtension
public FreshestCRLExtension(CRLDistributionPoint dp)
Creates a new FreshestCRL extension, with the given distribution point as the first element.
-
-
Method Detail
-
addPoint
public void addPoint(CRLDistributionPoint dp)
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
public CRLDistributionPoint getPointAt(int index)
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
public void encode(DerOutputStream out) throws java.io.IOException
Encodes this extension to the given DerOutputStream. This method re-encodes each time it is called, so it is not very efficient.
-
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
public java.lang.String 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
public void encode(java.io.OutputStream ostream) throws java.security.cert.CertificateException, java.io.IOExceptionDER-encodes this extension to the given OutputStream.- Specified by:
encodein interfaceCertAttrSet- Parameters:
ostream- the OutputStream to encode the attribute to.- Throws:
java.security.cert.CertificateException- on encoding or validity errors.java.io.IOException- on other errors.
-
decode
public void decode(java.io.InputStream in) throws java.security.cert.CertificateException, java.io.IOExceptionDescription 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:
java.security.cert.CertificateException- on decoding or validity errors.java.io.IOException- on other errors.
-
set
public void set(java.lang.String name, java.lang.Object obj) throws java.security.cert.CertificateException, java.io.IOExceptionDescription 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:
java.security.cert.CertificateException- on attribute handling errors.java.io.IOException- on other errors.
-
get
public java.lang.Object get(java.lang.String name) throws java.security.cert.CertificateException, java.io.IOExceptionDescription copied from interface:CertAttrSetGets an attribute value for this CertAttrSet.- Specified by:
getin interfaceCertAttrSet- Parameters:
name- the name of the attribute to return.- Throws:
java.security.cert.CertificateException- on attribute handling errors.java.io.IOException- on other errors.
-
delete
public void delete(java.lang.String name) throws java.security.cert.CertificateException, java.io.IOExceptionDescription copied from interface:CertAttrSetDeletes an attribute value from this CertAttrSet.- Specified by:
deletein interfaceCertAttrSet- Parameters:
name- the name of the attribute to delete.- Throws:
java.security.cert.CertificateException- on attribute handling errors.java.io.IOException- on other errors.
-
getAttributeNames
public java.util.Enumeration<java.lang.String> 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
public java.lang.String getName()
Description copied from interface:CertAttrSetReturns the name (identifier) of this CertAttrSet.- Specified by:
getNamein interfaceCertAttrSet- Returns:
- the name of this CertAttrSet.
-
main
public static void main(java.lang.String[] args)
Test driver.
-
-