public final class KeyStoreEntry
extends java.lang.Object
Constructor and Description |
---|
KeyStoreEntry(byte[] inp,
java.lang.String password)
Parses an input byte array and constructs a KeyStoreEntry
|
KeyStoreEntry(X509Certificate cert,
PrivateKey pPrk,
java.lang.String password)
Constructs a KeyStoreEntry from a couple of the PublickKeyInfo instance and
aPrivateKey instance
|
Modifier and Type | Method and Description |
---|---|
X509Certificate |
getCertificate()
Returns a Certificate instance from the KeyStoreEntry
|
java.lang.String |
getPEMEncoded()
Returns a couple of a certificate and its private key encoded
in the PEM format
|
byte[] |
getPKCS12Encoded()
Returns a couple of a certificate and its private key encoded
in the PKCS12 format
|
PrivateKey |
getPrivateKey()
Returns a PrivateKey instance of the KeyStoreEntry
|
public KeyStoreEntry(X509Certificate cert, PrivateKey pPrk, java.lang.String password) throws java.lang.SecurityException, KeyStoreException
cert
- the Certificate instancepPrk
- the PrivateKey instancepassword
- password for the PrivateKey instancejava.lang.SecurityException
- if there is not the KeyStorePermission permissionKeyStoreException
- if there is any other problem with
KeyStoreEntry creating (cert is
null, for instance)public KeyStoreEntry(byte[] inp, java.lang.String password) throws java.lang.SecurityException, KeyStoreException, java.security.spec.InvalidKeySpecException
inp
- the input byte arraypassword
- a password stringjava.lang.SecurityException
- if there is not the KeyStorePermission permissionKeyStoreException
- if there is any other problem with
KeyStoreEntry creating (cert is
null, for instance)java.security.spec.InvalidKeySpecException
- if there is a problem with keys
NOTE:
1. An input array must contain a certificate.
2. An input array in the PKCS12 format must contain exactly
one full couple of certificate/private key.public java.lang.String getPEMEncoded()
public byte[] getPKCS12Encoded()
public X509Certificate getCertificate()
public PrivateKey getPrivateKey()
Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved.