Package org.mozilla.jss.pkix.crmf
Class CertTemplate
java.lang.Object
org.mozilla.jss.pkix.crmf.CertTemplate
- All Implemented Interfaces:
ASN1Value
This class models a CRMF CertTemplate structure.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A class for decoding CertTemplates. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate SEQUENCE
private Name
private BIT_STRING
private Date
private Date
private SubjectPublicKeyInfo
private INTEGER
private AlgorithmIdentifier
private Name
private BIT_STRING
static final Tag
private static CertTemplate.Template
(package private) static final int
private INTEGER
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprivate static TimeBase
dateToASN1
(Date d) Converts a Date into a UTCTime or GeneralizedTime, depending on whether it falls before or after the cutoff date.void
encode
(OutputStream ostream) Write this value's DER encoding to an output stream using its own base tag.void
encode
(Tag t, OutputStream ostream) Write this value's DER encoding to an output stream using an implicit tag.extensionAt
(int idx) Returns the ith extension.Returns the issuer field of this CertTemplate.Returns the issuerUID field of this CertTemplate.Returns the notAfter field of this CertTemplate.Returns the notBefore field of this CertTemplate.Returns the publicKey field of this CertTemplate.Returns the serialNumber field of this CertTemplate.Returns the signingAlg field of this CertTemplate.Sets the subject field of this CertTemplate.Returns the subjectUID field of this CertTemplate.getTag()
Returns the base tag for this type, not counting any tags that may be imposed on it by its context.static CertTemplate.Template
Returns the version field of this CertTemplate.boolean
Returns true if the extensions field is present.boolean
Returns true if the issuer field is present.boolean
Returns true if the issuerUID field is present.boolean
Returns true if the notAfter field is present.boolean
Returns true if the notBefore field is present.boolean
Returns true if the publicKey field is present.boolean
Returns true if the serialNumber field is present.boolean
Returns true if the signingAlg field is present.boolean
Returns true if the subject field is present.boolean
Returns true if the subjectUID field is present.boolean
Returns true if the version field is present.static void
int
Returns the number of extensions present in the template.void
print
(PrintStream ps) void
setExtensions
(SEQUENCE extensions) Sets the extensions field of this CertTemplate.void
Sets the issuer field of this CertTemplate.void
setIssuerUID
(BIT_STRING issuerUID) Sets the issuerUID field of this CertTemplate.void
setNotAfter
(Date date) Sets the notAfter field of this CertTemplate.void
setNotBefore
(Date date) Sets the version field of this CertTemplate.void
setPublicKey
(SubjectPublicKeyInfo publicKey) Sets the publicKey field of this CertTemplate.void
setSerialNumber
(INTEGER serialNumber) Sets the serialNumber field of this CertTemplate.void
setSigningAlg
(AlgorithmIdentifier signingAlg) Sets the signingAlg field of this CertTemplate.void
setSubject
(Name subject) Sets the subject field of this CertTemplate.void
setSubjectUID
(BIT_STRING subjectUID) Sets the subjectUID field of this CertTemplate.void
setVersion
(INTEGER version) Sets the version field of this CertTemplate.
-
Field Details
-
version
-
serialNumber
-
signingAlg
-
issuer
-
notBefore
-
notAfter
-
subject
-
publicKey
-
issuerUID
-
subjectUID
-
extensions
-
TAG
-
UTCTIME_CUTOFF_YEAR
static final int UTCTIME_CUTOFF_YEAR- See Also:
-
templateInstance
-
-
Constructor Details
-
CertTemplate
public CertTemplate()Creates an empty CertTemplate. Use the accessor methods to fill it up with stuff.
-
-
Method Details
-
hasVersion
public boolean hasVersion()Returns true if the version field is present. -
getVersion
Returns the version field of this CertTemplate. -
setVersion
Sets the version field of this CertTemplate. -
hasSerialNumber
public boolean hasSerialNumber()Returns true if the serialNumber field is present. -
getSerialNumber
Returns the serialNumber field of this CertTemplate. -
setSerialNumber
Sets the serialNumber field of this CertTemplate. -
hasSigningAlg
public boolean hasSigningAlg()Returns true if the signingAlg field is present. -
getSigningAlg
Returns the signingAlg field of this CertTemplate. -
setSigningAlg
Sets the signingAlg field of this CertTemplate. -
hasIssuer
public boolean hasIssuer()Returns true if the issuer field is present. -
getIssuer
Returns the issuer field of this CertTemplate. -
setIssuer
Sets the issuer field of this CertTemplate. -
hasNotBefore
public boolean hasNotBefore()Returns true if the notBefore field is present. -
getNotBefore
Returns the notBefore field of this CertTemplate. -
setNotBefore
Sets the version field of this CertTemplate. -
hasNotAfter
public boolean hasNotAfter()Returns true if the notAfter field is present. -
getNotAfter
Returns the notAfter field of this CertTemplate. -
setNotAfter
Sets the notAfter field of this CertTemplate. -
hasSubject
public boolean hasSubject()Returns true if the subject field is present. -
getSubject
Sets the subject field of this CertTemplate. -
setSubject
Sets the subject field of this CertTemplate. -
hasPublicKey
public boolean hasPublicKey()Returns true if the publicKey field is present. -
getPublicKey
Returns the publicKey field of this CertTemplate. -
setPublicKey
Sets the publicKey field of this CertTemplate. -
hasIssuerUID
public boolean hasIssuerUID()Returns true if the issuerUID field is present. -
getIssuerUID
Returns the issuerUID field of this CertTemplate. -
setIssuerUID
Sets the issuerUID field of this CertTemplate. -
hasSubjectUID
public boolean hasSubjectUID()Returns true if the subjectUID field is present. -
getSubjectUID
Returns the subjectUID field of this CertTemplate. -
setSubjectUID
Sets the subjectUID field of this CertTemplate. -
hasExtensions
public boolean hasExtensions()Returns true if the extensions field is present. -
setExtensions
Sets the extensions field of this CertTemplate. -
numExtensions
public int numExtensions()Returns the number of extensions present in the template. May be zero. -
extensionAt
Returns the ith extension.- Parameters:
idx
- The index of the extension to retrieve. Must be in the range [ 0, numExtensions()-1 ].
-
print
- Throws:
InvalidBERException
-
getTag
Description copied from interface:ASN1Value
Returns the base tag for this type, not counting any tags that may be imposed on it by its context. -
encode
Description copied from interface:ASN1Value
Write this value's DER encoding to an output stream using its own base tag.- Specified by:
encode
in interfaceASN1Value
- Parameters:
ostream
- Output stream.- Throws:
IOException
- If an error occurred.
-
dateToASN1
Converts a Date into a UTCTime or GeneralizedTime, depending on whether it falls before or after the cutoff date. -
encode
Description copied from interface:ASN1Value
Write this value's DER encoding to an output stream using an implicit tag.- Specified by:
encode
in interfaceASN1Value
- Parameters:
t
- Implicit tag.ostream
- Output stream.- Throws:
IOException
- If an error occurred.
-
getTemplate
-
main
-