public class LoadPKCS12Certificate
extends java.lang.Object
Constructor and Description |
---|
LoadPKCS12Certificate(byte[] pkcs12FileContent,
java.lang.String password)
Create a new instance - Load the binary content of a PKCS#12 file into a (transient) key store and initialize a key manager factory.
|
LoadPKCS12Certificate(java.lang.String pkcs12FilePath,
java.lang.String password)
Create a new instance - Load a PKCS#12 file into a (transient) key store and initialize a key manager factory.
|
Modifier and Type | Method and Description |
---|---|
boolean |
containsPrivateKey()
Get if the key store contains a private key.
|
boolean |
containsPrivateKey(java.lang.String alias)
Get if an alias of the key store contains a private key.
|
void |
dumpKeyStore()
Dump the key store of the loaded certificate(s) to stdout.
|
java.util.ArrayList<java.lang.String> |
getAliases()
Get all aliases of the key store.
|
javax.net.ssl.KeyManagerFactory |
getKeyManagerFactory()
Get the key manager factory.
|
javax.net.ssl.KeyManager[] |
getKeyManagers()
Get the key managers.
|
java.security.KeyStore |
getKeyStore()
Get the key store.
|
java.util.ArrayList<java.lang.String> |
getKeyStoreDump()
Get a dump of the loaded certificate(s).
|
public LoadPKCS12Certificate(java.lang.String pkcs12FilePath, java.lang.String password) throws java.lang.Exception
pkcs12FilePath
- the file path to the PKCS#12 filepassword
- the password for the PKCS#12 filejava.lang.Exception
- if somewhat failspublic LoadPKCS12Certificate(byte[] pkcs12FileContent, java.lang.String password) throws java.lang.Exception
pkcs12FileContent
- the binary content of the PKCS#12 filepassword
- the password for the PKCS#12 filejava.lang.Exception
- if somewhat failspublic java.security.KeyStore getKeyStore()
public javax.net.ssl.KeyManagerFactory getKeyManagerFactory()
public javax.net.ssl.KeyManager[] getKeyManagers()
public java.util.ArrayList<java.lang.String> getAliases() throws java.lang.Exception
java.lang.Exception
- if somewhat failspublic boolean containsPrivateKey() throws java.lang.Exception
java.lang.Exception
- if somewhat failspublic boolean containsPrivateKey(java.lang.String alias) throws java.lang.Exception
alias
- the alias of the key storejava.lang.Exception
- if somewhat failsgetAliases()
public void dumpKeyStore() throws java.lang.Exception
java.lang.Exception
- if somewhat failspublic java.util.ArrayList<java.lang.String> getKeyStoreDump() throws java.lang.Exception
java.lang.Exception
- if somewhat fails