|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object core.crypto.ExportImport
public class ExportImport
This class provides methods to export certificates and secret keys.
Copyright (c) 2006 Sebastian Erdweg Copyright (c) 2006 Dominik Schulz Copyright (c) 2006 Florian Lindner Copyright (c) 2006 Betim Berjani This file is part of FlexiCrypt. FlexiCrypt is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. FlexiCrypt is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with FlexiCrypt; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Method Summary | |
---|---|
static void |
exportPKCS12DER(PrivateKey privateKey,
Certificate cert,
Certificate[] chain,
File file,
char[] pass)
Exports a PCKS#12-Keystore. |
static X509Certificate |
readCertificateBase64(File file)
|
static X509Certificate |
readCertificateDER(File file)
|
static KeyStore.PrivateKeyEntry |
readCertificatePrivateKeyPKCS12DER(File file,
char[] pass)
|
static SecretKey |
readSecretKeyXML(File file,
char[] password)
|
static void |
writeCertificateBase64(Certificate cert,
File file)
|
static void |
writeCertificateDER(Certificate cert,
File file)
|
static void |
writeCertificatePrivateKeyPKCS12DER(PrivateKey privateKey,
Certificate cert,
Certificate[] chain,
File file,
char[] pass)
Exports a private key with a certificate based on the PKCS#12 standard PKCS#12 will be DER encoded |
static void |
writeSecretKeyXML(SecretKey secretKey,
File file,
char[] password)
Exports a secret key base64 encoded |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static X509Certificate readCertificateBase64(File file) throws Exception
Exception
public static X509Certificate readCertificateDER(File file) throws Exception
Exception
public static SecretKey readSecretKeyXML(File file, char[] password) throws Exception
Exception
public static KeyStore.PrivateKeyEntry readCertificatePrivateKeyPKCS12DER(File file, char[] pass) throws Exception
Exception
public static void writeCertificateBase64(Certificate cert, File file) throws CertificateEncodingException, IOException, NoSuchAlgorithmException, InvalidKeySpecException, InvalidKeyException, NoSuchPaddingException, InvalidAlgorithmParameterException, InterruptedException
CertificateEncodingException
IOException
NoSuchAlgorithmException
InvalidKeySpecException
InvalidKeyException
NoSuchPaddingException
InvalidAlgorithmParameterException
InterruptedException
public static void writeCertificateDER(Certificate cert, File file) throws Exception
Exception
public static void writeCertificatePrivateKeyPKCS12DER(PrivateKey privateKey, Certificate cert, Certificate[] chain, File file, char[] pass) throws Exception
privateKey
- cert
- chain
- file
- pass
-
Exception
public static void exportPKCS12DER(PrivateKey privateKey, Certificate cert, Certificate[] chain, File file, char[] pass) throws KeyStoreException, NoSuchAlgorithmException, CertificateException, IOException
privateKey
- chain
- file
- pass
-
KeyStoreException
NoSuchAlgorithmException
CertificateException
IOException
public static void writeSecretKeyXML(SecretKey secretKey, File file, char[] password) throws InvalidKeyException, NoSuchPaddingException, NoSuchAlgorithmException, IOException, InvalidAlgorithmParameterException, InterruptedException
secretKey
- file
- password
-
InvalidKeyException
NoSuchPaddingException
NoSuchAlgorithmException
IOException
InterruptedException
InvalidAlgorithmParameterException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |