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) |
|
|---|---|
java.lang.Object
|
|
KeyStore.PrivateKeyEntry (PrivateKey privateKey, Certificate[] chain)
使用 PrivateKey和相应的证书链构造 PrivateKeyEntry 。
指定的 chain在存储在新的 PrivateKeyEntry对象中之前被克隆。
| 参数(Parameters) | |
|---|---|
privateKey |
PrivateKey: the PrivateKey |
chain |
Certificate: an array of Certificates 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 Certificates 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 Certificates 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. |