public class SslCertificate
extends Object
java.lang.Object | |
↳ | android.net.http.SslCertificate |
SSL证书信息(证书详细信息)类
Nested classes |
|
---|---|
class |
SslCertificate.DName 一个可分辨的名称助手类:一个三元组:
|
Public constructors |
|
---|---|
SslCertificate(String issuedTo, String issuedBy, String validNotBefore, String validNotAfter) 此构造函数在API级别8中已弃用。请使用 |
|
SslCertificate(String issuedTo, String issuedBy, Date validNotBefore, Date validNotAfter) 此构造函数在API级别12中已弃用。请使用 |
|
SslCertificate(X509Certificate certificate) 从X509证书创建一个新的SSL证书对象 |
Public methods |
|
---|---|
SslCertificate.DName |
getIssuedBy() |
SslCertificate.DName |
getIssuedTo() |
String |
getValidNotAfter() 此方法在API级别8中已弃用。请使用 |
Date |
getValidNotAfterDate() |
String |
getValidNotBefore() 此方法在API级别8中已弃用。请使用 |
Date |
getValidNotBeforeDate() |
static SslCertificate |
restoreState(Bundle bundle) 恢复存储在捆绑包中的证书 |
static Bundle |
saveState(SslCertificate certificate) 将证书状态保存为一个包 |
String |
toString() 返回对象的字符串表示形式。 |
Inherited methods |
|
---|---|
From class java.lang.Object
|
SslCertificate (String issuedTo, String issuedBy, String validNotBefore, String validNotAfter)
此构造函数在API级别8中已被弃用。
使用SslCertificate(X509Certificate)
创建一个新的SSL证书对象
Parameters | |
---|---|
issuedTo |
String : The entity this certificate is issued to |
issuedBy |
String : The entity that issued this certificate |
validNotBefore |
String : The not-before date from the certificate validity period in ISO 8601 format |
validNotAfter |
String : The not-after date from the certificate validity period in ISO 8601 format |
SslCertificate (String issuedTo, String issuedBy, Date validNotBefore, Date validNotAfter)
此构造函数在API级别12中已被弃用。
使用SslCertificate(X509Certificate)
创建一个新的SSL证书对象
Parameters | |
---|---|
issuedTo |
String : The entity this certificate is issued to |
issuedBy |
String : The entity that issued this certificate |
validNotBefore |
Date : The not-before date from the certificate validity period |
validNotAfter |
Date : The not-after date from the certificate validity period |
SslCertificate (X509Certificate certificate)
从X509证书创建一个新的SSL证书对象
Parameters | |
---|---|
certificate |
X509Certificate : X509 certificate |
SslCertificate.DName getIssuedBy ()
Returns | |
---|---|
SslCertificate.DName |
Issued-by distinguished name or null if none has been set |
SslCertificate.DName getIssuedTo ()
Returns | |
---|---|
SslCertificate.DName |
Issued-to distinguished name or null if none has been set |
String getValidNotAfter ()
此方法在API级别8中已被弃用。
使用getValidNotAfterDate()
Returns | |
---|---|
String |
Not-after date from the certificate validity period in ISO 8601 format or "" if none has been set |
Date getValidNotAfterDate ()
Returns | |
---|---|
Date |
Not-after date from the certificate validity period or "" if none has been set |
String getValidNotBefore ()
此方法在API级别8中已被弃用。
使用getValidNotBeforeDate()
Returns | |
---|---|
String |
Not-before date from the certificate validity period in ISO 8601 format or "" if none has been set |
Date getValidNotBeforeDate ()
Returns | |
---|---|
Date |
Not-before date from the certificate validity period or "" if none has been set |
SslCertificate restoreState (Bundle bundle)
恢复存储在捆绑包中的证书
Parameters | |
---|---|
bundle |
Bundle : The bundle with the certificate state stored in it |
Returns | |
---|---|
SslCertificate |
The SSL certificate stored in the bundle or null if fails |
Bundle saveState (SslCertificate certificate)
将证书状态保存为一个包
Parameters | |
---|---|
certificate |
SslCertificate : The SSL certificate to store |
Returns | |
---|---|
Bundle |
A bundle with the certificate stored in it or null if fails |
String toString ()
返回对象的字符串表示形式。 通常, toString
方法返回一个“文本表示”该对象的字符串。 结果应该是一个简洁但内容丰富的表述,对于一个人来说很容易阅读。 建议所有子类重写此方法。
类Object
的toString
方法返回一个字符串,其中包含对象为实例的类的名称,符号字符“ @
”以及对象的哈希代码的无符号十六进制表示形式。 换句话说,这个方法返回一个字符串,其值等于:
getClass().getName() + '@' + Integer.toHexString(hashCode())
Returns | |
---|---|
String |
A string representation of this certificate for debugging |