de.fuberlin.wiwiss.ng4j.swp.util
Class PKCS12Utils
java.lang.Object
de.fuberlin.wiwiss.ng4j.swp.util.PKCS12Utils
public class PKCS12Utils
- extends Object
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PKCS12Utils
public PKCS12Utils()
loadAndDecryptPKCS12
public static KeyStore loadAndDecryptPKCS12(String keyStoreFileName,
String password)
throws SWPSignatureException,
SWPCertificateException,
SWPPKCS12Exception
- Loads and decrypt the PCKS12 file specified in the configuration properties.
- Returns:
- the PKCS12 object, already decrypted.
- Throws:
SWPSignatureException
SWPCertificateException
SWPPKCS12Exception
loadPrivateKey
public static PrivateKey loadPrivateKey(KeyStore ks,
String alias,
String password)
throws KeyStoreException,
NoSuchAlgorithmException,
UnrecoverableKeyException
- Loads the private key from a file specified in the configuration properties.
- Returns:
- the private key.
- Throws:
UnrecoverableKeyException
NoSuchAlgorithmException
KeyStoreException
decryptPrivateKey
public static PrivateKey decryptPrivateKey(String pkcs12,
String password)
throws SWPSignatureException
- Throws:
SWPSignatureException
getCertChain
public static Certificate[] getCertChain(String pkcs12,
String password)