public static final class KeyStore.PrivateKeyEntry extends Object implements KeyStore.Entry
KeyStore
条目,持有
PrivateKey
和相应的证书链。
KeyStore.Entry.Attribute
Constructor and Description |
---|
PrivateKeyEntry(PrivateKey privateKey, Certificate[] chain)
构建一个与
PrivateKey 和相应的证书链
PrivateKeyEntry 。
|
PrivateKeyEntry(PrivateKey privateKey, Certificate[] chain, Set<KeyStore.Entry.Attribute> attributes)
构建一个与
PrivateKey 和相应的证书链
PrivateKeyEntry 和相关条目属性。
|
Modifier and Type | Method and Description |
---|---|
Set<KeyStore.Entry.Attribute> |
getAttributes()
检索与条目关联的属性。
|
Certificate |
getCertificate()
从这个入口证书链获取终端实体
Certificate 。
|
Certificate[] |
getCertificateChain()
从这项得到
Certificate 链。
|
PrivateKey |
getPrivateKey()
从这项得到
PrivateKey 。
|
String |
toString()
返回该privatekeyentry字符串表示形式。
|
public PrivateKeyEntry(PrivateKey privateKey, Certificate[] chain)
PrivateKey
和相应的证书链
PrivateKeyEntry
。
克隆之前,它是存储在新的PrivateKeyEntry
对象指定的chain
。
privateKey
-
PrivateKey
chain
-代表证书链
Certificate
s数组。链必须有序和包含在索引0
Certificate
对应的私钥。
NullPointerException
-如果
privateKey
或
chain
是
null
IllegalArgumentException
-如果指定链长度为0,如果指定的链不包含相同类型的
Certificate
s,或者如果
PrivateKey
算法不匹配,最后实体
Certificate
的
PublicKey
算法(索引0)
public PrivateKeyEntry(PrivateKey privateKey, Certificate[] chain, Set<KeyStore.Entry.Attribute> attributes)
PrivateKey
和相应的证书链
PrivateKeyEntry
和相关条目属性。
指定的chain
和attributes
克隆之前,它们被存储在新的PrivateKeyEntry
对象。
privateKey
-
PrivateKey
chain
-代表证书链
Certificate
s数组。链必须有序和包含在索引0对应的私钥
Certificate
。
attributes
-属性
NullPointerException
-如果
privateKey
,
chain
或
attributes
是
null
IllegalArgumentException
-如果指定链长度为0,如果指定的链不包含相同类型的
Certificate
s,或者如果
PrivateKey
算法不匹配,最后实体
Certificate
的
PublicKey
算法(索引0)
public PrivateKey getPrivateKey()
PrivateKey
。
PrivateKey
public Certificate[] getCertificateChain()
Certificate
链。
存储的链在返回之前被克隆。
Certificate
s对应的公钥的证书链。如果证书的类型是X.509,返回数组的运行时类型是
X509Certificate[]
。
public Certificate getCertificate()
Certificate
。
Certificate
(索引0)从这个入口证书链。如果证书是X.509证书的类型,返回的运行时类型是
X509Certificate
。
public Set<KeyStore.Entry.Attribute> getAttributes()
getAttributes
接口
KeyStore.Entry
Set
,可能是空的
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.