public class X509CertInfo
extends java.lang.Object
X.509 certificates have several base data elements, including:
X509CertImpl| Modifier and Type | Field and Description |
|---|---|
protected CertificateAlgorithmId |
algId |
static java.lang.String |
ALGORITHM_ID |
static java.lang.String |
DN_NAME |
protected CertificateExtensions |
extensions |
static java.lang.String |
EXTENSIONS |
protected CertificateValidity |
interval |
protected X500Name |
issuer |
static java.lang.String |
ISSUER |
static java.lang.String |
ISSUER_ID |
protected UniqueIdentity |
issuerUniqueId |
static java.lang.String |
KEY |
static java.lang.String |
NAME |
protected CertificateX509Key |
pubKey |
static java.lang.String |
SERIAL_NUMBER |
protected CertificateSerialNumber |
serialNum |
protected X500Name |
subject |
static java.lang.String |
SUBJECT |
static java.lang.String |
SUBJECT_ID |
protected UniqueIdentity |
subjectUniqueId |
static java.lang.String |
VALIDITY |
protected CertificateVersion |
version |
static java.lang.String |
VERSION |
| Constructor and Description |
|---|
X509CertInfo()
Construct an uninitialized X509CertInfo on which
decode must later be called (or which may be deserialized).
|
X509CertInfo(byte[] cert)
Unmarshals a certificate from its encoded form, parsing the
encoded bytes.
|
X509CertInfo(com.tencent.kona.sun.security.util.DerValue derVal)
Unmarshal a certificate from its encoded form, parsing a DER value.
|
| Modifier and Type | Method and Description |
|---|---|
void |
encode(com.tencent.kona.sun.security.util.DerOutputStream out)
Appends the certificate to an output stream.
|
boolean |
equals(java.lang.Object other)
Compares two X509CertInfo objects.
|
boolean |
equals(X509CertInfo other)
Compares two certificates, returning false if any data
differs between the two.
|
CertificateAlgorithmId |
getAlgorithmId() |
byte[] |
getEncodedInfo()
Returns the encoded certificate info.
|
CertificateExtensions |
getExtensions() |
X500Name |
getIssuer() |
UniqueIdentity |
getIssuerUniqueId() |
CertificateX509Key |
getKey() |
java.lang.String |
getName()
Return the name of this attribute.
|
CertificateSerialNumber |
getSerialNumber() |
X500Name |
getSubject() |
UniqueIdentity |
getSubjectUniqueId() |
CertificateValidity |
getValidity() |
CertificateVersion |
getVersion() |
int |
hashCode()
Calculates a hash code value for the object.
|
void |
setAlgorithmId(CertificateAlgorithmId val)
Set the algorithm id of the certificate.
|
void |
setExtensions(CertificateExtensions val)
Set the extensions in the certificate.
|
void |
setIssuer(X500Name val)
Set the issuer name of the certificate.
|
void |
setIssuerUniqueId(UniqueIdentity val)
Set the Issuer Unique Identity in the certificate.
|
void |
setKey(CertificateX509Key val)
Set the public key in the certificate.
|
void |
setSerialNumber(CertificateSerialNumber val)
Set the serial number of the certificate.
|
void |
setSubject(X500Name val)
Set the subject name of the certificate.
|
void |
setSubjectUniqueId(UniqueIdentity val)
Set the Subject Unique Identity in the certificate.
|
void |
setValidity(CertificateValidity val)
Set the validity interval of the certificate.
|
void |
setVersion(CertificateVersion val)
Set the version number of the certificate.
|
java.lang.String |
toString()
Returns a printable representation of the certificate.
|
public static final java.lang.String NAME
public static final java.lang.String DN_NAME
public static final java.lang.String VERSION
public static final java.lang.String SERIAL_NUMBER
public static final java.lang.String ALGORITHM_ID
public static final java.lang.String ISSUER
public static final java.lang.String SUBJECT
public static final java.lang.String VALIDITY
public static final java.lang.String KEY
public static final java.lang.String ISSUER_ID
public static final java.lang.String SUBJECT_ID
public static final java.lang.String EXTENSIONS
protected CertificateVersion version
protected CertificateSerialNumber serialNum
protected CertificateAlgorithmId algId
protected X500Name issuer
protected X500Name subject
protected CertificateValidity interval
protected CertificateX509Key pubKey
protected UniqueIdentity issuerUniqueId
protected UniqueIdentity subjectUniqueId
protected CertificateExtensions extensions
public X509CertInfo()
public X509CertInfo(byte[] cert)
throws java.security.cert.CertificateParsingException
cert - the encoded bytes, with no trailing data.java.security.cert.CertificateParsingException - on parsing errors.public X509CertInfo(com.tencent.kona.sun.security.util.DerValue derVal)
throws java.security.cert.CertificateParsingException
derVal - the der value containing the encoded cert.java.security.cert.CertificateParsingException - on parsing errors.public void encode(com.tencent.kona.sun.security.util.DerOutputStream out)
throws java.security.cert.CertificateException
out - an output stream to which the certificate is appended.java.security.cert.CertificateException - on encoding errors.java.io.IOException - on other errors.public java.lang.String getName()
public byte[] getEncodedInfo()
throws java.security.cert.CertificateEncodingException
java.security.cert.CertificateEncodingException - on encoding information errors.public boolean equals(java.lang.Object other)
equals in class java.lang.Objectother - the object being compared with this onepublic boolean equals(X509CertInfo other)
other - the object being compared with this onepublic int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.Objectpublic CertificateExtensions getExtensions()
public UniqueIdentity getIssuerUniqueId()
public UniqueIdentity getSubjectUniqueId()
public X500Name getIssuer()
public X500Name getSubject()
public void setVersion(CertificateVersion val)
val - the Object class value for the Extensionsjava.security.cert.CertificateException - on invalid data.public CertificateVersion getVersion()
public void setSerialNumber(CertificateSerialNumber val)
val - the Object class value for the CertificateSerialNumberjava.security.cert.CertificateException - on invalid data.public CertificateSerialNumber getSerialNumber()
public void setAlgorithmId(CertificateAlgorithmId val)
val - the Object class value for the AlgorithmIdjava.security.cert.CertificateException - on invalid data.public CertificateAlgorithmId getAlgorithmId()
public void setIssuer(X500Name val)
val - the Object class value for the issuerjava.security.cert.CertificateException - on invalid data.public void setValidity(CertificateValidity val)
val - the Object class value for the CertificateValidityjava.security.cert.CertificateException - on invalid data.public CertificateValidity getValidity()
public void setSubject(X500Name val) throws java.security.cert.CertificateException
val - the Object class value for the Subjectjava.security.cert.CertificateException - on invalid data.public void setKey(CertificateX509Key val)
val - the Object class value for the PublicKeyjava.security.cert.CertificateException - on invalid data.public CertificateX509Key getKey()
public void setIssuerUniqueId(UniqueIdentity val) throws java.security.cert.CertificateException
val - the Object class value for the IssuerUniqueIdjava.security.cert.CertificateExceptionpublic void setSubjectUniqueId(UniqueIdentity val) throws java.security.cert.CertificateException
val - the Object class value for the SubjectUniqueIdjava.security.cert.CertificateExceptionpublic void setExtensions(CertificateExtensions val) throws java.security.cert.CertificateException
val - the Object class value for the Extensionsjava.security.cert.CertificateException