|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sourceforge.jcetaglib.tools.KeyTools
Tools to handle common key and keystore operations.
Method Summary | |
static java.security.KeyStore |
createP12(java.lang.String alias,
java.security.PrivateKey privKey,
java.security.cert.X509Certificate cert,
java.security.cert.Certificate[] cachain)
Creates PKCS12-file that can be imported in IE or Netscape. |
static java.security.KeyStore |
createP12(java.lang.String alias,
java.security.PrivateKey privKey,
java.security.cert.X509Certificate cert,
java.security.cert.X509Certificate cacert)
Creates PKCS12-file that can be imported in IE or Netscape. |
static java.security.PrivateKey |
decryptPrivateKey(byte[] wrappedKey,
java.lang.String password)
decrypts an RSA private key. |
static java.security.cert.Certificate[] |
getCertChain(java.security.KeyStore keyStore,
java.lang.String privateKeyAlias)
Retrieves the certificate chain from a keystore. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static java.security.KeyStore createP12(java.lang.String alias, java.security.PrivateKey privKey, java.security.cert.X509Certificate cert, java.security.cert.X509Certificate cacert) throws java.lang.Exception
alias
- the alias used for the key entryprivKey
- RSA private keycert
- user certificatecacert
- CA-certificate or null if only one cert in chain, in that case use 'cert'.
java.lang.Exception
- if input parameters are not OK or certificate generation failspublic static java.security.KeyStore createP12(java.lang.String alias, java.security.PrivateKey privKey, java.security.cert.X509Certificate cert, java.security.cert.Certificate[] cachain) throws java.lang.Exception
alias
- the alias used for the key entryprivKey
- RSA private keycert
- user certificatecachain
- CA-certificate chain or null if only one cert in chain, in that case use 'cert'.
java.lang.Exception
- if input parameters are not OK or certificate generation failspublic static java.security.cert.Certificate[] getCertChain(java.security.KeyStore keyStore, java.lang.String privateKeyAlias) throws java.security.KeyStoreException
keyStore
- the keystore, which has been loaded and opened.privateKeyAlias
- the alias of the privatekey for which the certchain belongs.
java.security.KeyStoreException
public static java.security.PrivateKey decryptPrivateKey(byte[] wrappedKey, java.lang.String password) throws java.lang.Exception
wrappedKey
- the key in bytespassword
- password as string
java.lang.Exception
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |