public static final class KeyStore.PrivateKeyEntry
extends Object
implements KeyStore.Entry
java.lang.Object | |
↳ | java.security.KeyStore.PrivateKeyEntry |
包含 PrivateKey
和相应证书链的 KeyStore
条目。
Public constructors |
|
---|---|
KeyStore.PrivateKeyEntry(PrivateKey privateKey, Certificate[] chain) 用 |
Public methods |
|
---|---|
Certificate |
getCertificate() 在 |
Certificate[] |
getCertificateChain() 从此条目获取 |
PrivateKey |
getPrivateKey() 从此条目获取 |
String |
toString() 返回此PrivateKeyEntry的字符串表示形式。 |
Inherited methods |
|
---|---|
From class java.lang.Object
|
KeyStore.PrivateKeyEntry (PrivateKey privateKey, Certificate[] chain)
使用 PrivateKey
和相应的证书链构造 PrivateKeyEntry
。
指定的 chain
在存储在新的 PrivateKeyEntry
对象中之前被克隆。
Parameters | |
---|---|
privateKey |
PrivateKey : the PrivateKey |
chain |
Certificate : an array of Certificate s representing the certificate chain. The chain must be ordered and contain a Certificate at index 0 corresponding to the private key. |
Throws | |
---|---|
NullPointerException |
if privateKey or chain is null |
IllegalArgumentException |
if the specified chain has a length of 0, if the specified chain does not contain Certificate s of the same type, or if the PrivateKey algorithm does not match the algorithm of the PublicKey in the end entity Certificate (at index 0) |
Certificate getCertificate ()
在 Certificate
从证书链获取最终实体 Certificate
。
Returns | |
---|---|
Certificate |
the end entity Certificate (at index 0) from the certificate chain in this entry. If the certificate is of type X.509, the runtime type of the returned certificate is X509Certificate . |
Certificate[] getCertificateChain ()
从此条目获取 Certificate
链。
存储的链在返回之前被克隆。
Returns | |
---|---|
Certificate[] |
an array of Certificate s corresponding to the certificate chain for the public key. If the certificates are of type X.509, the runtime type of the returned array is X509Certificate[] . |
PrivateKey getPrivateKey ()
从此条目获取 PrivateKey
。
Returns | |
---|---|
PrivateKey |
the PrivateKey from this entry |
String toString ()
返回此PrivateKeyEntry的字符串表示形式。
Returns | |
---|---|
String |
a string representation of this PrivateKeyEntry. |