Class RevokedCertImpl
java.lang.Object
java.security.cert.X509CRLEntry
org.mozilla.jss.netscape.security.x509.RevokedCertificate
org.mozilla.jss.netscape.security.x509.RevokedCertImpl
- All Implemented Interfaces:
Serializable,X509Extension
Abstract class for a revoked certificate in a CRL. This class is for each entry in the
revokedCertificates, so it deals with the inner SEQUENCE. The ASN.1 definition for this is:
revokedCertificates SEQUENCE OF SEQUENCE {
userCertificate CertificateSerialNumber,
revocationDate ChoiceOfTime,
crlEntryExtensions Extensions OPTIONAL
-- if present, must be v2
} OPTIONAL
CertificateSerialNumber ::= INTEGER
Extensions ::= SEQUENCE SIZE (1..MAX) OF Extension
Extension ::= SEQUENCE {
extnId OBJECT IDENTIFIER,
critical BOOLEAN DEFAULT FALSE,
extnValue OCTET STRING
-- contains a DER encoding of a value
-- of the type registered for use with
-- the extnId object identifier value
}
- Version:
- 1.6 97/12/10
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate CRLExtensionsprivate static final booleanprivate Dateprivate byte[]private SerialNumberprivate static final long -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor.RevokedCertImpl(byte[] revokedCert) Unmarshals a revoked certificate from its encoded form.RevokedCertImpl(BigInteger num, Date date) Constructs a revoked certificate entry using the serial number and revocation date.RevokedCertImpl(BigInteger num, Date date, CRLExtensions crlEntryExts) Constructs a revoked certificate entry using the serial number, revocation date and the entry extensions.RevokedCertImpl(DerValue derValue) Unmarshals a revoked certificate from its encoded form. -
Method Summary
Modifier and TypeMethodDescriptionvoiddecode(InputStream inStrm) Decode a revoked certificate from an input stream.voidencode(DerOutputStream outStrm) Encodes the revoked certificate to an output stream.Gets a Set of the extension(s) marked CRITICAL in the RevokedCertificate by OID strings.byte[]Returns extensions for this impl.byte[]getExtensionValue(String oid) Gets the DER encoded OCTET string for the extension value (extnValue) identified by the passed in oid String.Gets a Set of the extension(s) marked NON-CRITICAL in the RevokedCertificate by OID strings.Gets the revocation date for this RevokedCertificate, the revocationDate.Gets the serial number for this RevokedCertificate, the userCertificate.booleanReturns true if this revoked certificate entry has extensions, otherwise false.booleanprivate voidprivate voidreadObject(ObjectInputStream stream) Serialization read ...voidsetExtensions(CRLExtensions crlEntryExts) Sets extensions for this impl.toString()Returns a printable string of this revoked certificate.private voidwriteObject(ObjectOutputStream stream) Serialization write ...Methods inherited from class java.security.cert.X509CRLEntry
equals, getCertificateIssuer, getRevocationReason, hashCode
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
serialNumber
-
revocationDate
-
extensions
-
revokedCert
private byte[] revokedCert -
isExplicit
private static final boolean isExplicit- See Also:
-
-
Constructor Details
-
RevokedCertImpl
public RevokedCertImpl()Default constructor. -
RevokedCertImpl
Constructs a revoked certificate entry using the serial number and revocation date.- Parameters:
num- the serial number of the revoked certificate.date- the Date on which revocation took place.
-
RevokedCertImpl
Constructs a revoked certificate entry using the serial number, revocation date and the entry extensions.- Parameters:
num- the serial number of the revoked certificate.date- the Date on which revocation took place.crlEntryExts- the extensions for this entry.
-
RevokedCertImpl
Unmarshals a revoked certificate from its encoded form.- Parameters:
revokedCert- the encoded bytes.- Throws:
CRLException- on parsing errors.X509ExtensionException- on extension handling errors.
-
RevokedCertImpl
Unmarshals a revoked certificate from its encoded form.- Parameters:
derValue- the DER value containing the revoked certificate.- Throws:
CRLException- on parsing errors.X509ExtensionException- on extension handling errors.
-
-
Method Details
-
getEncoded
- Specified by:
getEncodedin classX509CRLEntry- Throws:
CRLException
-
hasUnsupportedCriticalExtension
public boolean hasUnsupportedCriticalExtension()- Specified by:
hasUnsupportedCriticalExtensionin interfaceX509Extension
-
setExtensions
Sets extensions for this impl.- Parameters:
crlEntryExts- CRLExtensions
-
hasExtensions
public boolean hasExtensions()Returns true if this revoked certificate entry has extensions, otherwise false.- Specified by:
hasExtensionsin classRevokedCertificate- Returns:
- true if this CRL entry has extensions, otherwise false.
-
decode
Decode a revoked certificate from an input stream.- Parameters:
inStrm- an input stream holding at least one revoked certificate- Throws:
CRLException- on parsing errors.X509ExtensionException- on extension handling errors.
-
encode
Encodes the revoked certificate to an output stream.- Parameters:
outStrm- an output stream to which the encoded revoked certificate is written.- Throws:
CRLException- on encoding errors.X509ExtensionException- on extension handling errors.
-
getSerialNumber
Gets the serial number for this RevokedCertificate, the userCertificate.- Specified by:
getSerialNumberin classRevokedCertificate- Returns:
- the serial number.
-
getRevocationDate
Gets the revocation date for this RevokedCertificate, the revocationDate.- Specified by:
getRevocationDatein classRevokedCertificate- Returns:
- the revocation date.
-
getExtensions
Returns extensions for this impl.- Specified by:
getExtensionsin classRevokedCertificate- Returns:
- the CRLExtensions
-
toString
Returns a printable string of this revoked certificate.- Specified by:
toStringin classRevokedCertificate- Returns:
- value of this revoked certificate in a printable form.
-
getCriticalExtensionOIDs
Gets a Set of the extension(s) marked CRITICAL in the RevokedCertificate by OID strings.- Specified by:
getCriticalExtensionOIDsin interfaceX509Extension- Returns:
- a set of the extension oid strings in the Object that are marked critical.
-
getNonCriticalExtensionOIDs
Gets a Set of the extension(s) marked NON-CRITICAL in the RevokedCertificate by OID strings.- Specified by:
getNonCriticalExtensionOIDsin interfaceX509Extension- Returns:
- a set of the extension oid strings in the Object that are marked critical.
-
getExtensionValue
Gets the DER encoded OCTET string for the extension value (extnValue) identified by the passed in oid String. Theoidstring is represented by a set of positive whole number separated by ".", that means,
<positive whole number>.<positive whole number>.<positive whole number>.<...>- Specified by:
getExtensionValuein interfaceX509Extension- Parameters:
oid- the Object Identifier value for the extension.- Returns:
- the DER encoded octet string of the extension value.
-
parse
- Throws:
CRLExceptionX509ExtensionException
-
writeObject
private void writeObject(ObjectOutputStream stream) throws CRLException, X509ExtensionException, IOException Serialization write ... X.509 certificates serialize as themselves, and they're parsed when they get read back. (Actually they serialize as some type data from the serialization subsystem, then the cert data.) -
readObject
Serialization read ... X.509 certificates serialize as themselves, and they're parsed when they get read back.- Throws:
CRLExceptionX509ExtensionException
-