|
JCas v0.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cas.io.ImportKey
Class for importing certificates and keys.
This class provides a method for importing a certificate and
a private key into a key store. Both the key and the
certificate must be in DER
-format. The key must be
encoded with PKCS#8
-format. The certificate must be
encoded in X.509
-format.
Key format:
openssl pkcs8 -topk8 -nocrypt -in YOUR.KEY -out YOUR.KEY.der
-outform der
Format of the certificate:
openssl x509 -in YOUR.CERT -out YOUR.CERT.der -outform
der
Import key and certificate:
java comu.ImportKey YOUR.KEY.der YOUR.CERT.der
Constructor Summary | |
ImportKey()
|
Method Summary | |
static void |
importKey(KeyStore ks,
String keyfile,
String certfile,
char[] keypass,
String alias)
Imports a certificate and its private key. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public ImportKey()
Method Detail |
public static void importKey(KeyStore ks, String keyfile, String certfile, char[] keypass, String alias) throws IOException, GeneralSecurityException
Private key must be in PKCS8-format.
Certificate must be in X.509-format.
If alias is key is imported with the alias importkey
ks
- - keystore to usekeyfile
- - the private key to importcertfile
- - the certificate to importkeypass
- - the password of the private keyalias
- - Alias for the key.
IOException
GeneralSecurityException
|
JCas v0.3.1 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |