Skip to content

Most visited

Recently visited

navigation
Added in API level 1

KeyStore.PrivateKeyEntry

public static final class KeyStore.PrivateKeyEntry
extends Object implements KeyStore.Entry

java.lang.Object
   ↳ java.security.KeyStore.PrivateKeyEntry


PrivateKeyEntry represents a KeyStore entry that holds a private key.

Summary

Public constructors

KeyStore.PrivateKeyEntry(PrivateKey privateKey, Certificate[] chain)

Constructs a new instance of PrivateKeyEntry with the given PrivateKey and the provided certificate chain.

Public methods

Certificate getCertificate()

Returns the certificate corresponding to the private key.

Certificate[] getCertificateChain()

Returns the certificate chain.

PrivateKey getPrivateKey()

Returns the private key.

String toString()

Returns a string containing a concise, human-readable description of this PrivateKeyEntry.

Inherited methods

From class java.lang.Object

Public constructors

KeyStore.PrivateKeyEntry

Added in API level 1
KeyStore.PrivateKeyEntry (PrivateKey privateKey, 
                Certificate[] chain)

Constructs a new instance of PrivateKeyEntry with the given PrivateKey and the provided certificate chain.

Parameters
privateKey PrivateKey: the private key.
chain Certificate: the ordered certificate chain with the certificate corresponding to the private key at index 0.
Throws
NullPointerException if privateKey or chain is null.
IllegalArgumentException if chain.length == 0, the algorithm of the private key does not match the algorithm of the public key of the first certificate or the certificates are not all of the same type.

Public methods

getCertificate

Added in API level 1
Certificate getCertificate ()

Returns the certificate corresponding to the private key.

Returns
Certificate the certificate corresponding to the private key.

getCertificateChain

Added in API level 1
Certificate[] getCertificateChain ()

Returns the certificate chain.

Returns
Certificate[] the certificate chain.

getPrivateKey

Added in API level 1
PrivateKey getPrivateKey ()

Returns the private key.

Returns
PrivateKey the private key.

toString

Added in API level 1
String toString ()

Returns a string containing a concise, human-readable description of this PrivateKeyEntry.

Returns
String a printable representation for this PrivateKeyEntry.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.