org.mozilla.jss.pkix.crmf

Class CertTemplate

public class CertTemplate extends Object implements ASN1Value

This class models a CRMF CertTemplate structure.
Nested Class Summary
static classCertTemplate.Template
A class for decoding CertTemplates.
Field Summary
static TagTAG
Constructor Summary
CertTemplate()
Creates an empty CertTemplate.
Method Summary
voidencode(OutputStream ostream)
voidencode(Tag t, OutputStream ostream)
ExtensionextensionAt(int idx)
Returns the ith extension.
NamegetIssuer()
Returns the issuer field of this CertTemplate.
BIT_STRINGgetIssuerUID()
Returns the issuerUID field of this CertTemplate.
DategetNotAfter()
Returns the notAfter field of this CertTemplate.
DategetNotBefore()
Returns the notBefore field of this CertTemplate.
SubjectPublicKeyInfogetPublicKey()
Returns the publicKey field of this CertTemplate.
INTEGERgetSerialNumber()
Returns the serialNumber field of this CertTemplate.
AlgorithmIdentifiergetSigningAlg()
Returns the signingAlg field of this CertTemplate.
NamegetSubject()
Sets the subject field of this CertTemplate.
BIT_STRINGgetSubjectUID()
Returns the subjectUID field of this CertTemplate.
TaggetTag()
static CertTemplate.TemplategetTemplate()
INTEGERgetVersion()
Returns the version field of this CertTemplate.
booleanhasExtensions()
Returns true if the extensions field is present.
booleanhasIssuer()
Returns true if the issuer field is present.
booleanhasIssuerUID()
Returns true if the issuerUID field is present.
booleanhasNotAfter()
Returns true if the notAfter field is present.
booleanhasNotBefore()
Returns true if the notBefore field is present.
booleanhasPublicKey()
Returns true if the publicKey field is present.
booleanhasSerialNumber()
Returns true if the serialNumber field is present.
booleanhasSigningAlg()
Returns true if the signingAlg field is present.
booleanhasSubject()
Returns true if the subject field is present.
booleanhasSubjectUID()
Returns true if the subjectUID field is present.
booleanhasVersion()
Returns true if the version field is present.
static voidmain(String[] args)
intnumExtensions()
Returns the number of extensions present in the template.
voidprint(PrintStream ps, int indentSpaces)
voidsetExtensions(SEQUENCE extensions)
Sets the extensions field of this CertTemplate.
voidsetIssuer(Name issuer)
Sets the issuer field of this CertTemplate.
voidsetIssuerUID(BIT_STRING issuerUID)
Sets the issuerUID field of this CertTemplate.
voidsetNotAfter(Date date)
Sets the notAfter field of this CertTemplate.
voidsetNotBefore(Date date)
Sets the version field of this CertTemplate.
voidsetPublicKey(SubjectPublicKeyInfo publicKey)
Sets the publicKey field of this CertTemplate.
voidsetSerialNumber(INTEGER serialNumber)
Sets the serialNumber field of this CertTemplate.
voidsetSigningAlg(AlgorithmIdentifier signingAlg)
Sets the signingAlg field of this CertTemplate.
voidsetSubject(Name subject)
Sets the subject field of this CertTemplate.
voidsetSubjectUID(BIT_STRING subjectUID)
Sets the subjectUID field of this CertTemplate.
voidsetVersion(INTEGER version)
Sets the version field of this CertTemplate.

Field Detail

TAG

public static final Tag TAG

Constructor Detail

CertTemplate

public CertTemplate()
Creates an empty CertTemplate. Use the accessor methods to fill it up with stuff.

Method Detail

encode

public void encode(OutputStream ostream)

encode

public void encode(Tag t, OutputStream ostream)

extensionAt

public Extension extensionAt(int idx)
Returns the ith extension.

Parameters: idx The index of the extension to retrieve. Must be in the range [ 0, numExtensions()-1 ].

getIssuer

public Name getIssuer()
Returns the issuer field of this CertTemplate.

getIssuerUID

public BIT_STRING getIssuerUID()
Returns the issuerUID field of this CertTemplate.

getNotAfter

public Date getNotAfter()
Returns the notAfter field of this CertTemplate.

getNotBefore

public Date getNotBefore()
Returns the notBefore field of this CertTemplate.

getPublicKey

public SubjectPublicKeyInfo getPublicKey()
Returns the publicKey field of this CertTemplate.

getSerialNumber

public INTEGER getSerialNumber()
Returns the serialNumber field of this CertTemplate.

getSigningAlg

public AlgorithmIdentifier getSigningAlg()
Returns the signingAlg field of this CertTemplate.

getSubject

public Name getSubject()
Sets the subject field of this CertTemplate.

getSubjectUID

public BIT_STRING getSubjectUID()
Returns the subjectUID field of this CertTemplate.

getTag

public Tag getTag()

getTemplate

public static CertTemplate.Template getTemplate()

getVersion

public INTEGER getVersion()
Returns the version field of this CertTemplate.

hasExtensions

public boolean hasExtensions()
Returns true if the extensions field is present.

hasIssuer

public boolean hasIssuer()
Returns true if the issuer field is present.

hasIssuerUID

public boolean hasIssuerUID()
Returns true if the issuerUID field is present.

hasNotAfter

public boolean hasNotAfter()
Returns true if the notAfter field is present.

hasNotBefore

public boolean hasNotBefore()
Returns true if the notBefore field is present.

hasPublicKey

public boolean hasPublicKey()
Returns true if the publicKey field is present.

hasSerialNumber

public boolean hasSerialNumber()
Returns true if the serialNumber field is present.

hasSigningAlg

public boolean hasSigningAlg()
Returns true if the signingAlg field is present.

hasSubject

public boolean hasSubject()
Returns true if the subject field is present.

hasSubjectUID

public boolean hasSubjectUID()
Returns true if the subjectUID field is present.

hasVersion

public boolean hasVersion()
Returns true if the version field is present.

main

public static void main(String[] args)

numExtensions

public int numExtensions()
Returns the number of extensions present in the template. May be zero.

print

public void print(PrintStream ps, int indentSpaces)

setExtensions

public void setExtensions(SEQUENCE extensions)
Sets the extensions field of this CertTemplate.

setIssuer

public void setIssuer(Name issuer)
Sets the issuer field of this CertTemplate.

setIssuerUID

public void setIssuerUID(BIT_STRING issuerUID)
Sets the issuerUID field of this CertTemplate.

setNotAfter

public void setNotAfter(Date date)
Sets the notAfter field of this CertTemplate.

setNotBefore

public void setNotBefore(Date date)
Sets the version field of this CertTemplate.

setPublicKey

public void setPublicKey(SubjectPublicKeyInfo publicKey)
Sets the publicKey field of this CertTemplate.

setSerialNumber

public void setSerialNumber(INTEGER serialNumber)
Sets the serialNumber field of this CertTemplate.

setSigningAlg

public void setSigningAlg(AlgorithmIdentifier signingAlg)
Sets the signingAlg field of this CertTemplate.

setSubject

public void setSubject(Name subject)
Sets the subject field of this CertTemplate.

setSubjectUID

public void setSubjectUID(BIT_STRING subjectUID)
Sets the subjectUID field of this CertTemplate.

setVersion

public void setVersion(INTEGER version)
Sets the version field of this CertTemplate.