Package org.mozilla.jss.pkix.cert
Class CertificateInfo
java.lang.Object
org.mozilla.jss.pkix.cert.CertificateInfo
- All Implemented Interfaces:
ASN1Value
A TBSCertificate (to-be-signed certificate), the actual information in
a certificate apart from the signature.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classTemplate class for decoding a CertificateInfo.static classAn X.509 Certificate version. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SEQUENCEprivate Nameprivate BIT_STRINGprivate Dateprivate Dateprivate INTEGERprivate AlgorithmIdentifierprivate Nameprivate SubjectPublicKeyInfoprivate BIT_STRING(package private) static final Tagprivate static final CertificateInfo.Template(package private) static final intstatic final CertificateInfo.Versionstatic final CertificateInfo.Versionstatic final CertificateInfo.Versionprivate CertificateInfo.Version -
Constructor Summary
ConstructorsConstructorDescriptionCertificateInfo(CertificateInfo.Version version, INTEGER serialNumber, AlgorithmIdentifier signatureAlgId, Name issuer, Date notBefore, Date notAfter, Name subject, SubjectPublicKeyInfo subjectPublicKeyInfo) Creates a CertificateInfo with the required fields. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddExtension(Extension extension) voidencode(OutputStream ostream) Write this value's DER encoding to an output stream using its own base tag.voidencode(Tag implicitTag, OutputStream ostream) Write this value's DER encoding to an output stream using an implicit tag.private static ASN1ValueReturns the correct ASN1Value (UTCTime or GeneralizedTime) to represent the given certificate validity date.Linearly searches the extension list for an extension with the given object identifier.Returns the extensions of this certificate.Should only be called if this field is present.getTag()Returns the base tag for this type, not counting any tags that may be imposed on it by its context.static CertificateInfo.TemplatebooleanbooleanbooleanbooleanLinearly searches the extension list for an extension with the given object identifier.voidprint(PrintStream ps) voidsetExtensions(SEQUENCE extensions) voidvoidsetIssuerUniqueIdentifier(BIT_STRING issuerUniqueIdentifier) voidsetNotAfter(Date notAfter) voidsetNotBefore(Date notBefore) voidsetSerialNumber(INTEGER serialNumber) voidsetSignatureAlgId(AlgorithmIdentifier signatureAlgId) voidsetSubject(Name subject) voidExtracts the SubjectPublicKeyInfo from the given public key and stores it in the CertificateInfo.voidsetSubjectPublicKeyInfo(SubjectPublicKeyInfo subjectPublicKeyInfo) voidsetSubjectUniqueIdentifier(BIT_STRING subjectUniqueIdentifier) voidsetVersion(CertificateInfo.Version version) private voidverifyNotNull(Object obj)
-
Field Details
-
v1
-
v2
-
v3
-
UTCTIME_CUTOFF_YEAR
static final int UTCTIME_CUTOFF_YEAR- See Also:
-
version
-
serialNumber
-
signatureAlgId
-
issuer
-
notBefore
-
notAfter
-
subject
-
subjectPublicKeyInfo
-
issuerUniqueIdentifier
-
subjectUniqueIdentifier
-
extensions
-
TAG
-
templateInstance
-
-
Constructor Details
-
CertificateInfo
public CertificateInfo(CertificateInfo.Version version, INTEGER serialNumber, AlgorithmIdentifier signatureAlgId, Name issuer, Date notBefore, Date notAfter, Name subject, SubjectPublicKeyInfo subjectPublicKeyInfo) Creates a CertificateInfo with the required fields.
-
-
Method Details
-
setVersion
-
getVersion
-
setSerialNumber
-
getSerialNumber
-
setSignatureAlgId
-
getSignatureAlgId
-
setIssuer
-
getIssuer
-
setNotBefore
-
getNotBefore
-
setNotAfter
-
getNotAfter
-
setSubject
-
getSubject
-
setSubjectPublicKeyInfo
-
setSubjectPublicKeyInfo
Extracts the SubjectPublicKeyInfo from the given public key and stores it in the CertificateInfo.- Throws:
InvalidBERException- If an error occurs decoding the the information extracted from the public key.IOException
-
getSubjectPublicKeyInfo
-
setIssuerUniqueIdentifier
public void setIssuerUniqueIdentifier(BIT_STRING issuerUniqueIdentifier) throws CertificateException - Throws:
CertificateException- If the certificate is a v1 certificate.
-
hasIssuerUniqueIdentifier
public boolean hasIssuerUniqueIdentifier() -
getIssuerUniqueIdentifier
Should only be called if this field is present. -
setSubjectUniqueIdentifier
public void setSubjectUniqueIdentifier(BIT_STRING subjectUniqueIdentifier) throws CertificateException - Throws:
CertificateException- If the certificate is a v1 certificate.
-
hasSubjectUniqueIdentifier
public boolean hasSubjectUniqueIdentifier() -
getSubjectUniqueIdentifier
-
hasExtensions
public boolean hasExtensions() -
getExtensions
Returns the extensions of this certificate. The sequence may be empty, but this method will never returnnull. -
isExtensionPresent
Linearly searches the extension list for an extension with the given object identifier. If it finds one, returnstrue. Otherwise, returnsfalse. -
getExtension
Linearly searches the extension list for an extension with the given object identifier. It returns the first one it finds. If none are found, returnsnull. -
setExtensions
- Throws:
CertificateException- If the certificate is not a v3 certificate.
-
addExtension
- Throws:
CertificateException- If the certificate is not a v3 certificate.
-
verifyNotNull
-
getTag
Description copied from interface:ASN1ValueReturns the base tag for this type, not counting any tags that may be imposed on it by its context. -
encode
Description copied from interface:ASN1ValueWrite this value's DER encoding to an output stream using its own base tag.- Specified by:
encodein interfaceASN1Value- Parameters:
ostream- Output stream.- Throws:
IOException- If an error occurred.
-
encode
Description copied from interface:ASN1ValueWrite this value's DER encoding to an output stream using an implicit tag.- Specified by:
encodein interfaceASN1Value- Parameters:
implicitTag- Implicit tag.ostream- Output stream.- Throws:
IOException- If an error occurred.
-
encodeValidityDate
Returns the correct ASN1Value (UTCTime or GeneralizedTime) to represent the given certificate validity date. -
getTemplate
-
print
- Throws:
InvalidBERException
-