Package org.mozilla.jss.pkix.cert
Class CertificateInfo
- java.lang.Object
-
- org.mozilla.jss.pkix.cert.CertificateInfo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classCertificateInfo.TemplateTemplate class for decoding a CertificateInfo.static classCertificateInfo.VersionAn X.509 Certificate version.
-
Field Summary
Fields Modifier and Type Field Description static CertificateInfo.Versionv1static CertificateInfo.Versionv2static CertificateInfo.Versionv3
-
Constructor Summary
Constructors Constructor Description CertificateInfo(CertificateInfo.Version version, INTEGER serialNumber, AlgorithmIdentifier signatureAlgId, Name issuer, java.util.Date notBefore, java.util.Date notAfter, Name subject, SubjectPublicKeyInfo subjectPublicKeyInfo)Creates a CertificateInfo with the required fields.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddExtension(Extension extension)voidencode(java.io.OutputStream ostream)Write this value's DER encoding to an output stream using its own base tag.voidencode(Tag implicitTag, java.io.OutputStream ostream)Write this value's DER encoding to an output stream using an implicit tag.ExtensiongetExtension(OBJECT_IDENTIFIER oid)Linearly searches the extension list for an extension with the given object identifier.SEQUENCEgetExtensions()Returns the extensions of this certificate.NamegetIssuer()BIT_STRINGgetIssuerUniqueIdentifier()Should only be called if this field is present.java.util.DategetNotAfter()java.util.DategetNotBefore()INTEGERgetSerialNumber()AlgorithmIdentifiergetSignatureAlgId()NamegetSubject()SubjectPublicKeyInfogetSubjectPublicKeyInfo()BIT_STRINGgetSubjectUniqueIdentifier()TaggetTag()Returns the base tag for this type, not counting any tags that may be imposed on it by its context.static CertificateInfo.TemplategetTemplate()CertificateInfo.VersiongetVersion()booleanhasExtensions()booleanhasIssuerUniqueIdentifier()booleanhasSubjectUniqueIdentifier()booleanisExtensionPresent(OBJECT_IDENTIFIER oid)Linearly searches the extension list for an extension with the given object identifier.voidprint(java.io.PrintStream ps)voidsetExtensions(SEQUENCE extensions)voidsetIssuer(Name issuer)voidsetIssuerUniqueIdentifier(BIT_STRING issuerUniqueIdentifier)voidsetNotAfter(java.util.Date notAfter)voidsetNotBefore(java.util.Date notBefore)voidsetSerialNumber(INTEGER serialNumber)voidsetSignatureAlgId(AlgorithmIdentifier signatureAlgId)voidsetSubject(Name subject)voidsetSubjectPublicKeyInfo(java.security.PublicKey pubk)Extracts the SubjectPublicKeyInfo from the given public key and stores it in the CertificateInfo.voidsetSubjectPublicKeyInfo(SubjectPublicKeyInfo subjectPublicKeyInfo)voidsetSubjectUniqueIdentifier(BIT_STRING subjectUniqueIdentifier)voidsetVersion(CertificateInfo.Version version)
-
-
-
Field Detail
-
v1
public static final CertificateInfo.Version v1
-
v2
public static final CertificateInfo.Version v2
-
v3
public static final CertificateInfo.Version v3
-
-
Constructor Detail
-
CertificateInfo
public CertificateInfo(CertificateInfo.Version version, INTEGER serialNumber, AlgorithmIdentifier signatureAlgId, Name issuer, java.util.Date notBefore, java.util.Date notAfter, Name subject, SubjectPublicKeyInfo subjectPublicKeyInfo)
Creates a CertificateInfo with the required fields.
-
-
Method Detail
-
setVersion
public void setVersion(CertificateInfo.Version version)
-
getVersion
public CertificateInfo.Version getVersion()
-
setSerialNumber
public void setSerialNumber(INTEGER serialNumber)
-
getSerialNumber
public INTEGER getSerialNumber()
-
setSignatureAlgId
public void setSignatureAlgId(AlgorithmIdentifier signatureAlgId)
-
getSignatureAlgId
public AlgorithmIdentifier getSignatureAlgId()
-
setIssuer
public void setIssuer(Name issuer)
-
getIssuer
public Name getIssuer()
-
setNotBefore
public void setNotBefore(java.util.Date notBefore)
-
getNotBefore
public java.util.Date getNotBefore()
-
setNotAfter
public void setNotAfter(java.util.Date notAfter)
-
getNotAfter
public java.util.Date getNotAfter()
-
setSubject
public void setSubject(Name subject)
-
getSubject
public Name getSubject()
-
setSubjectPublicKeyInfo
public void setSubjectPublicKeyInfo(SubjectPublicKeyInfo subjectPublicKeyInfo)
-
setSubjectPublicKeyInfo
public void setSubjectPublicKeyInfo(java.security.PublicKey pubk) throws InvalidBERException, java.io.IOExceptionExtracts 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.java.io.IOException
-
getSubjectPublicKeyInfo
public SubjectPublicKeyInfo getSubjectPublicKeyInfo()
-
setIssuerUniqueIdentifier
public void setIssuerUniqueIdentifier(BIT_STRING issuerUniqueIdentifier) throws java.security.cert.CertificateException
- Throws:
java.security.cert.CertificateException- If the certificate is a v1 certificate.
-
hasIssuerUniqueIdentifier
public boolean hasIssuerUniqueIdentifier()
-
getIssuerUniqueIdentifier
public BIT_STRING getIssuerUniqueIdentifier()
Should only be called if this field is present.
-
setSubjectUniqueIdentifier
public void setSubjectUniqueIdentifier(BIT_STRING subjectUniqueIdentifier) throws java.security.cert.CertificateException
- Throws:
java.security.cert.CertificateException- If the certificate is a v1 certificate.
-
hasSubjectUniqueIdentifier
public boolean hasSubjectUniqueIdentifier()
-
getSubjectUniqueIdentifier
public BIT_STRING getSubjectUniqueIdentifier()
-
hasExtensions
public boolean hasExtensions()
-
getExtensions
public SEQUENCE getExtensions()
Returns the extensions of this certificate. The sequence may be empty, but this method will never returnnull.
-
isExtensionPresent
public boolean isExtensionPresent(OBJECT_IDENTIFIER oid)
Linearly searches the extension list for an extension with the given object identifier. If it finds one, returnstrue. Otherwise, returnsfalse.
-
getExtension
public Extension getExtension(OBJECT_IDENTIFIER oid)
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
public void setExtensions(SEQUENCE extensions) throws java.security.cert.CertificateException
- Throws:
java.security.cert.CertificateException- If the certificate is not a v3 certificate.
-
addExtension
public void addExtension(Extension extension) throws java.security.cert.CertificateException
- Throws:
java.security.cert.CertificateException- If the certificate is not a v3 certificate.
-
getTag
public Tag 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
public void encode(java.io.OutputStream ostream) throws java.io.IOExceptionDescription copied from interface:ASN1ValueWrite this value's DER encoding to an output stream using its own base tag.
-
encode
public void encode(Tag implicitTag, java.io.OutputStream ostream) throws java.io.IOException
Description copied from interface:ASN1ValueWrite this value's DER encoding to an output stream using an implicit tag.
-
getTemplate
public static CertificateInfo.Template getTemplate()
-
print
public void print(java.io.PrintStream ps) throws java.io.IOException, InvalidBERException- Throws:
java.io.IOExceptionInvalidBERException
-
-