org.neociclo.odetteftp.util
Class SecurityUtil
java.lang.Object
org.neociclo.odetteftp.util.SecurityUtil
public class SecurityUtil
- extends Object
- Version:
- $Rev: 311 $ $Date: 2010-05-07 11:46:40 -0300 (Fri, 07 May 2010) $
- Author:
- Rafael Marins
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BC_PROVIDER
public static final String BC_PROVIDER
- BouncyCastle JCE Provider name.
DEFAULT_OFTP_HASH_ALGORITHM
public static final String DEFAULT_OFTP_HASH_ALGORITHM
- Use SHA-1 as hash generation algorithm.
- See Also:
- Constant Field Values
SecurityUtil
public SecurityUtil()
openKeyStore
public static KeyStore openKeyStore(File path,
char[] password)
throws KeyStoreException,
NoSuchProviderException,
NoSuchAlgorithmException,
CertificateException,
IOException
- Throws:
KeyStoreException
NoSuchProviderException
NoSuchAlgorithmException
CertificateException
IOException
getPrivateKey
public static PrivateKey getPrivateKey(KeyStore ks,
char[] password)
throws KeyStoreException,
NoSuchAlgorithmException,
UnrecoverableKeyException
- Throws:
KeyStoreException
NoSuchAlgorithmException
UnrecoverableKeyException
openCertificate
public static X509Certificate openCertificate(File path)
throws FileNotFoundException,
CertificateException,
NoSuchProviderException
- Throws:
FileNotFoundException
CertificateException
NoSuchProviderException
installBouncyCastleProviderIfNecessary
public static void installBouncyCastleProviderIfNecessary()
getCertificateEntry
public static X509Certificate getCertificateEntry(KeyStore ks)
throws KeyStoreException
- Throws:
KeyStoreException
computeFileHash
public static byte[] computeFileHash(File file,
String algorithm)
throws NoSuchAlgorithmException,
NoSuchProviderException,
IOException
- Throws:
NoSuchAlgorithmException
NoSuchProviderException
IOException
ACCORD