public class CertTemplate extends java.lang.Object implements ASN1Type
CertTemplate ::= SEQUENCE {
version [0] IMPLICIT Version OPTIONAL,
serialNumber [1] IMPLICIT INTEGER OPTIONAL,
signingAlg [2] IMPLICIT AlgorithmIdentifier OPTIONAL,
issuer [3] Name OPTIONAL,
validity [4] IMPLICIT OptionalValidity OPTIONAL,
subject [5] Name OPTIONAL,
publicKey [6] IMPLICIT SubjectPublicKeyInfo OPTIONAL,
issuerUID [7] IMPLICIT UniqueIdentifier OPTIONAL,
subjectUID [8] IMPLICIT UniqueIdentifier OPTIONAL,
extensions [9] IMPLICIT Extensions OPTIONAL
}
| Modifier and Type | Field and Description |
|---|---|
static int |
version_v1
Version value - v1.
|
static int |
version_v2
Version value - v2.
|
static int |
version_v3
Version value - v3.
|
| Constructor and Description |
|---|
CertTemplate()
Creates a new (empty)
CertTemplate object. |
CertTemplate(ASN1Object obj)
Creates a
CertTemplate object from an ASN1Object. |
| Modifier and Type | Method and Description |
|---|---|
void |
addExtension(V3Extension extension)
Adds the specified extension.
|
void |
decode(ASN1Object obj)
Decodes a CertTemplate structure from an
ASN1Object. |
V3Extension |
getExtension(ObjectID oid)
Returns a specific extension, identified by its object identifier, if it
exists in the; otherwise
null is returned. |
X509Extensions |
getExtensions()
Returns the extensions.
|
Name |
getIssuer()
Returns the issuer if it has be set; otherwise
null is
returned. |
java.lang.String |
getIssuerUID()
Returns the issuer unique ID if it has be set; otherwise
null
is returned. |
java.security.PublicKey |
getPublicKey()
Returns the public key if it has be set; otherwise
null is
returned. |
java.math.BigInteger |
getSerialNumber()
Returns the serial number if it has be set; otherwise
null is
returned. |
AlgorithmID |
getSigningAlg()
Returns the signature algorithm if it has be set; otherwise
null is returned. |
Name |
getSubject()
Returns the subject if it has be set; otherwise
null is
returned. |
java.lang.String |
getSubjectUID()
Returns the subject unique ID if it has be set; otherwise
null
is returned. |
OptionalValidity |
getValidity()
Returns the validity if it has be set; otherwise
null is
returned. |
int |
getVersion()
Returns the version if it has be set; otherwise -1 is returned.
|
void |
setExtensions(X509Extensions extensions)
Sets the extensions.
|
void |
setIssuer(Name issuer)
Sets the issuer.
|
void |
setIssuerUID(java.lang.String issuerUID)
Sets the issuer unique ID.
|
void |
setPublicKey(java.security.PublicKey publicKey)
Sets the public key.
|
void |
setSerialNumber(java.math.BigInteger serialNumber)
Sets the serial number.
|
void |
setSigningAlg(AlgorithmID signingAlg)
Sets the signature algorithm.
|
void |
setSubject(Name subject)
Sets the subject.
|
void |
setSubjectUID(java.lang.String subjectUID)
Sets the subject unique ID.
|
void |
setValidity(OptionalValidity validity)
Sets the validity.
|
void |
setVersion(int version)
Sets the version.
|
ASN1Object |
toASN1Object()
Encodes this
CertTemplate as an ASN1Object. |
java.lang.String |
toString()
Creates a text representation of the ASN.1 structure of this
CertTemplate object. |
public static final int version_v1
public static final int version_v2
public static final int version_v3
public CertTemplate()
CertTemplate object.public CertTemplate(ASN1Object obj) throws CodingException
CertTemplate object from an ASN1Object.obj - the ASN.1 representation of a CertTemplate structureCodingException - thrown if an errors occurs while decoding the ANS1Objectpublic void setVersion(int version)
version - the version componentpublic void setSerialNumber(java.math.BigInteger serialNumber)
serialNumber - the serialNumber componentpublic void setSigningAlg(AlgorithmID signingAlg)
signingAlg - the signingAlg componentpublic void setIssuer(Name issuer)
issuer - the issuer componentpublic void setValidity(OptionalValidity validity)
validity - the validity componentpublic void setSubject(Name subject)
subject - the subject componentpublic void setPublicKey(java.security.PublicKey publicKey)
publicKey - the publicKey componentpublic void setIssuerUID(java.lang.String issuerUID)
issuerUID - the issuerUID componentpublic void setSubjectUID(java.lang.String subjectUID)
subjectUID - the subjectUID componentpublic void setExtensions(X509Extensions extensions)
extensions - the extensions componentpublic void addExtension(V3Extension extension) throws X509ExtensionException
extension - the extension to be addedX509ExtensionException - thrown if there is a problem with the extensionpublic int getVersion()
public java.math.BigInteger getSerialNumber()
null is
returned.public AlgorithmID getSigningAlg()
null is returned.public Name getIssuer()
null is
returned.public OptionalValidity getValidity()
null is
returned.public Name getSubject()
null is
returned.public java.security.PublicKey getPublicKey()
null is
returned.public java.lang.String getIssuerUID()
null
is returned.public java.lang.String getSubjectUID()
null
is returned.public X509Extensions getExtensions()
public V3Extension getExtension(ObjectID oid) throws X509ExtensionInitException
null is returned.X509ExtensionInitException - if there is a problem with the extensionpublic void decode(ASN1Object obj) throws CodingException
ASN1Object.decode in interface ASN1Typeobj - an ASN.1 representation of a CertTemplate structureCodingException - thrown if an errors occurs while decoding the ANS1Objectpublic ASN1Object toASN1Object()
CertTemplate as an ASN1Object.toASN1Object in interface ASN1Typepublic java.lang.String toString()
CertTemplate object.toString in class java.lang.Object