public final class Certificate
extends java.lang.Object
Constructor and Description |
---|
Certificate(java.lang.String issuerName, java.lang.String subjectName, boolean hasExpired, long startTime, long expiryTime, java.lang.String caFingerPrint, java.lang.String certData) |
Certificate(java.security.cert.X509Certificate certificate)
Constructs a new
Certificate instance from an X509Certificate.
|
Certificate(java.security.cert.X509Certificate certificate, java.security.PrivateKey key)
Constructs a new
Certificate instance from the X509Certificate and private key corresponded for this certificate.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getCAFingerPrint()
Returns the CA Fingerprint of certificate.
返回证书的CA指纹。 |
java.util.List<ExtendedKeyUsage> |
getExtendedKeyUsages()
Returns a list of extended key usages or empty collection if it's failed to extract extended key usages info from certificate because of corrupted data.
如果由于数据损坏而无法从证书中提取扩展密钥用法信息,则返回扩展密钥用法列表或空集合。 |
java.lang.String |
getFingerPrint()
Returns Fingerprint of certificate or empty string if it's failed to extract fingerprint from certificate because of corrupted data.
如果由于数据损坏而无法从证书中提取指纹,则返回证书的指纹或空字符串。 |
Principal |
getIssuer()
Returns the Issuer entity of certificate or
返回证书的颁发者实体,如果由于证书数据损坏而无法从证书数据中提取颁发者,则返回null。 null if it's failed to extract the issuer from certificate data because of corrupted certificate data.
|
java.lang.String |
getIssuerName()
Returns the name of the issuer of the certificate.
返回证书的颁发者的名称。 |
java.util.List<KeyUsage> |
getKeyUsages()
Returns a list of key usages or empty collection if it's failed to extract key usages info from certificate because of corrupted data.
如果由于数据损坏而无法从证书中提取密钥用法信息,则返回密钥用法列表或空集合。 |
java.security.PrivateKey |
getPrivateKey()
Returns the private key for the certificate.
返回证书的私钥。 |
java.lang.String |
getSerialNumber()
Returns the serial number of certificate or empty string if it's failed to extract serial number from certificate because of corrupted data.
如果由于数据损坏而无法从证书中提取序列号,则返回证书的序列号或空字符串。 |
Principal |
getSubject()
Returns the Subject entity of certificate or
返回证书的主题实体,如果由于证书数据损坏而无法从证书数据中提取主题,则返回null。 null if it's failed to extract the subject from certificate data because of corrupted certificate data.
|
java.util.List<SubjectAlternativeName> |
getSubjectAlternativeNames()
Returns a list of alternative subject names or empty collection if it's failed to extract alternative subject names info from certificate because of corrupted data.
如果由于数据损坏而无法从证书中提取备用使用者名称信息,则返回备用使用者名称列表或空集合。 |
java.lang.String |
getSubjectName()
Returns the name of the subject of the certificate.
返回证书主题的名称。 |
long |
getValidExpiryTime()
Returns a period of time in milliseconds that describes until what time the certificate is valid.
返回以毫秒为单位的时间段,该时间段描述直到证书有效的时间。 |
long |
getValidStartTime()
Returns a period of time in milliseconds starting from the certificate is valid.
从证书开始返回以毫秒为单位的有效时间。 |
java.security.cert.X509Certificate |
getX509Certificate()
Returns the
返回提供对所有证书信息的访问权限的X509Certificate,如果由于证书数据损坏而导致提取信息失败,则返回null。 X509Certificate that provides access to all certificate information or
null if it's failed to extract information because of corrupted certificate data.
|
boolean |
hasExpired()
Returns
如果证书已经过期,则返回true;否则返回false。 true if certificate has already expired, otherwise -
false .
|
java.lang.String |
toString() |
public Certificate(java.lang.String issuerName, java.lang.String subjectName, boolean hasExpired, long startTime, long expiryTime, java.lang.String caFingerPrint, java.lang.String certData)
public Certificate(java.security.cert.X509Certificate certificate)
Certificate
instance from an X509Certificate.
certificate
- the certificate.
- 证书。
java.lang.IllegalArgumentException
- when the
certificate
parameter is
null
.
public Certificate(java.security.cert.X509Certificate certificate, java.security.PrivateKey key)
Certificate
instance from the X509Certificate and private key corresponded for this certificate.
certificate
- the certificate.
- 证书。
key
- the private key.
-私钥。
java.lang.IllegalArgumentException
- when the
certificate
parameter is
null
.
public java.security.cert.X509Certificate getX509Certificate()
X509Certificate
that provides access to all certificate information or
null
if it's failed to extract information because of corrupted certificate data.
public Principal getIssuer()
null
if it's failed to extract the issuer from certificate data because of corrupted certificate data.
public java.lang.String getIssuerName()
public Principal getSubject()
null
if it's failed to extract the subject from certificate data because of corrupted certificate data.
public java.lang.String getSubjectName()
public boolean hasExpired()
true
if certificate has already expired, otherwise -
false
.
public long getValidStartTime()
public long getValidExpiryTime()
public java.lang.String getFingerPrint()
public java.lang.String getSerialNumber()
public java.util.List<KeyUsage> getKeyUsages()
public java.util.List<ExtendedKeyUsage> getExtendedKeyUsages()
public java.util.List<SubjectAlternativeName> getSubjectAlternativeNames()
public java.lang.String getCAFingerPrint()
X509Certificate
.
public java.lang.String toString()
toString
in class
java.lang.Object
public java.security.PrivateKey getPrivateKey()