- java.lang.Object
 -  
      
- java.security.KeyStore.PrivateKeyEntry
 
 
-  
       
- All Implemented Interfaces:
 -  
         
KeyStore.Entry 
- Enclosing class:
 - KeyStore
 
public static final class KeyStore.PrivateKeyEntry extends Object implements KeyStore.Entry
一个KeyStore条目,其中包含一个PrivateKey和相应的证书链。- 从以下版本开始:
 - 1.5
 
 
-  
        
       
-  
             
Nested Class Summary
-  
               
Nested classes/interfaces inherited from interface java.security.KeyStore.Entry
KeyStore.Entry.Attribute 
 -  
               
 
-  
             
构造方法摘要
构造方法 Constructor 描述 PrivateKeyEntry(PrivateKey privateKey, Certificate[] chain)构建一个PrivateKeyEntry与PrivateKey及相应的证书链。PrivateKeyEntry(PrivateKey privateKey, Certificate[] chain, Set<KeyStore.Entry.Attribute> attributes)构造一个具有PrivateKeyEntry的PrivateKey和相应的证书链和相关联的条目属性。 
-  
             
方法摘要
所有方法 接口方法 具体的方法 Modifier and Type 方法 描述 Set<KeyStore.Entry.Attribute>getAttributes()检索与条目关联的属性。CertificategetCertificate()从此条目中的证书链中获取终端实体Certificate。Certificate[]getCertificateChain()从此条目获取Certificate链。PrivateKeygetPrivateKey()从此条目获取PrivateKey。StringtoString()返回此PrivateKeyEntry的字符串表示形式。 
 -  
             
 
-  
        
       
-  
             
构造方法详细信息
-  
PrivateKeyEntry
public PrivateKeyEntry(PrivateKey privateKey, Certificate[] chain)
构建一个PrivateKeyEntry与PrivateKey及相应的证书链。指定的
chain在存储在新的PrivateKeyEntry对象之前被克隆。- 参数
 -  
              
privateKey-PrivateKey -  
              
chain- 表示证书链的Certificates的数组。 必须对该链进行排序,并在索引0处包含与Certificate对应的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对应的Certificate。 -  
              
attributes- 属性 - 异常
 -  
              
NullPointerException-如果privateKey,chain或者attributes为null -  
              
IllegalArgumentException-如果指定的链具有的长度为0,如果指定的链不包含CertificateS中的相同的类型,或者如果PrivateKey算法不所述的算法匹配PublicKey到底实体Certificate(索引0) - 从以下版本开始:
 - 1.8
 
 
 -  
 
-  
             
方法详细信息
-  
getPrivateKey
public PrivateKey getPrivateKey()
从此条目获取PrivateKey。- 结果
 -  
              
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
 
 
 -  
 
 -