@Singleton public class JCECrypto extends Object implements Crypto
| Modifier and Type | Field and Description |
|---|---|
static String |
HmacSHA1 |
static String |
HmacSHA256 |
static String |
MD5 |
static String |
SHA1 |
static String |
SHA256 |
static String |
SHA512 |
| Constructor and Description |
|---|
JCECrypto() |
JCECrypto(Provider provider) |
| Modifier and Type | Method and Description |
|---|---|
CertificateFactory |
certFactory() |
Cipher |
cipher(String algorithm) |
MessageDigest |
digest(String algorithm) |
Mac |
hmac(String algorithm,
byte[] key) |
Mac |
hmacSHA1(byte[] key) |
Mac |
hmacSHA256(byte[] key) |
MessageDigest |
md5() |
KeyFactory |
rsaKeyFactory() |
KeyPairGenerator |
rsaKeyPairGenerator() |
MessageDigest |
sha1() |
MessageDigest |
sha256() |
MessageDigest |
sha512() |
public static final String MD5
public static final String SHA1
public static final String SHA256
public static final String SHA512
public static final String HmacSHA256
public static final String HmacSHA1
@Inject public JCECrypto() throws NoSuchAlgorithmException, CertificateException
public JCECrypto(@Nullable Provider provider) throws NoSuchAlgorithmException, CertificateException
public Mac hmac(String algorithm, byte[] key) throws NoSuchAlgorithmException, InvalidKeyException
hmac in interface CryptoNoSuchAlgorithmExceptionInvalidKeyExceptionpublic MessageDigest digest(String algorithm) throws NoSuchAlgorithmException
digest in interface CryptoNoSuchAlgorithmExceptionpublic Cipher cipher(String algorithm) throws NoSuchAlgorithmException, NoSuchPaddingException
cipher in interface CryptoNoSuchAlgorithmExceptionNoSuchPaddingExceptionpublic MessageDigest md5()
public MessageDigest sha1()
public MessageDigest sha256()
public MessageDigest sha512()
public Mac hmacSHA1(byte[] key) throws InvalidKeyException
hmacSHA1 in interface CryptoInvalidKeyExceptionpublic Mac hmacSHA256(byte[] key) throws InvalidKeyException
hmacSHA256 in interface CryptoInvalidKeyExceptionpublic CertificateFactory certFactory()
certFactory in interface Cryptopublic KeyFactory rsaKeyFactory()
rsaKeyFactory in interface Cryptopublic KeyPairGenerator rsaKeyPairGenerator()
rsaKeyPairGenerator in interface CryptoCopyright © 2009-2012 jclouds. All Rights Reserved.