@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 Crypto
NoSuchAlgorithmException
InvalidKeyException
public MessageDigest digest(String algorithm) throws NoSuchAlgorithmException
digest
in interface Crypto
NoSuchAlgorithmException
public Cipher cipher(String algorithm) throws NoSuchAlgorithmException, NoSuchPaddingException
cipher
in interface Crypto
NoSuchAlgorithmException
NoSuchPaddingException
public MessageDigest md5()
public MessageDigest sha1()
public MessageDigest sha256()
public MessageDigest sha512()
public Mac hmacSHA1(byte[] key) throws InvalidKeyException
hmacSHA1
in interface Crypto
InvalidKeyException
public Mac hmacSHA256(byte[] key) throws InvalidKeyException
hmacSHA256
in interface Crypto
InvalidKeyException
public CertificateFactory certFactory()
certFactory
in interface Crypto
public KeyFactory rsaKeyFactory()
rsaKeyFactory
in interface Crypto
public KeyPairGenerator rsaKeyPairGenerator()
rsaKeyPairGenerator
in interface Crypto
Copyright © 2009-2013 jclouds. All Rights Reserved.