- java.lang.Object
 -  
      
- java.security.KeyStore.PrivateKeyEntry
 
 
-  
       
- 实现的所有接口
 -  
         
KeyStore.Entry 
- Enclosing class:
 - KeyStore
 
public static final class KeyStore.PrivateKeyEntry extends Object implements KeyStore.Entry
包含PrivateKey和相应证书链的KeyStore条目。- 从以下版本开始:
 - 1.5
 
 
-  
        
       
-  
             
嵌套类汇总
-  
               
Nested classes/interfaces declared in interface java.security.KeyStore.Entry
KeyStore.Entry.Attribute 
 -  
               
 
-  
             
构造方法摘要
构造方法 构造器 描述 PrivateKeyEntry(PrivateKey privateKey, Certificate[] chain)使用PrivateKey和相应的证书链构造PrivateKeyEntry。PrivateKeyEntry(PrivateKey privateKey, Certificate[] chain, Set<KeyStore.Entry.Attribute> attributes)构造具有PrivateKeyEntry的PrivateKey以及相应的证书链和相关的条目属性。 
-  
             
方法摘要
所有方法 实例方法 具体的方法 变量和类型 方法 描述 Set<KeyStore.Entry.Attribute>getAttributes()检索与条目关联的属性。CertificategetCertificate()从此条目中的证书链获取最终实体Certificate。Certificate[]getCertificateChain()从此条目获取Certificate链。PrivateKeygetPrivateKey()从此条目获取PrivateKey。StringtoString()返回此PrivateKeyEntry的字符串表示形式。 
 -  
             
 
-  
        
       
-  
             
构造方法详细信息
-  
PrivateKeyEntry
public PrivateKeyEntry(PrivateKey privateKey, Certificate[] chain)
使用PrivateKey和相应的证书链构造PrivateKeyEntry。指定的
chain在存储到新的PrivateKeyEntry对象之前进行克隆。- 参数
 -  
              
privateKey-PrivateKey -  
              
chain- 表示证书链的Certificate数组。 必须对链进行排序,并在索引0处包含对应于私钥的Certificate。 - 异常
 -  
              
NullPointerException- 如果privateKey或chain是null -  
              
IllegalArgumentException-如果指定的链具有的长度为0,如果指定的链不包含CertificateS中的相同的类型,或者如果PrivateKey算法不所述的算法匹配PublicKey到底实体Certificate(索引0) 
 
-  
PrivateKeyEntry
public PrivateKeyEntry(PrivateKey privateKey, Certificate[] chain, Set<KeyStore.Entry.Attribute> attributes)
构造一个PrivateKeyEntry其中包含PrivateKey以及相应的证书链和相关的条目属性。指定的
chain和attributes在存储到新的PrivateKeyEntry对象之前进行克隆。- 参数
 -  
              
privateKey-PrivateKey -  
              
chain- 表示证书链的Certificate数组。 必须对链进行排序,并在索引0处包含对应于私钥的Certificate。 -  
              
attributes- 属性 - 异常
 -  
              
NullPointerException-如果privateKey,chain或attributes为null -  
              
IllegalArgumentException-如果指定的链具有的长度为0,如果指定的链不包含CertificateS中的相同的类型,或者如果PrivateKey算法不所述的算法匹配PublicKey到底实体Certificate(索引0) - 从以下版本开始:
 - 1.8
 
 
 -  
 
-  
             
方法详细信息
-  
getPrivateKey
public PrivateKey getPrivateKey()
从此条目获取PrivateKey。- 结果
 - 
               来自此条目的 
              
PrivateKey 
 
-  
getCertificateChain
public Certificate[] getCertificateChain()
从此条目获取Certificate链。存储的链在返回之前被克隆。
- 结果
 -  
              对应于公钥的证书链的
Certificate的数组。 如果证书的类型为X.509,则返回的数组的运行时类型为X509Certificate[]。 
 
-  
getCertificate
public Certificate getCertificate()
从此条目中的证书链获取最终实体Certificate。- 结果
 -  
              此条目中证书链的最终实体
Certificate(在索引0处)。 如果证书的类型为X.509,则返回证书的运行时类型为X509Certificate。 
 
-  
getAttributes
public Set<KeyStore.Entry.Attribute> getAttributes()
检索与条目关联的属性。- Specified by:
 -  
              
getAttributes接口KeyStore.Entry - 结果
 - 
               不可修改的 
              
Set属性,可能为空 - 从以下版本开始:
 - 1.8
 
 
 -  
 
 -