Package org.jclouds.encryption.internal
Class JCECrypto
- java.lang.Object
-
- org.jclouds.encryption.internal.JCECrypto
-
- All Implemented Interfaces:
Crypto
- Direct Known Subclasses:
BouncyCastleCrypto
@Singleton public class JCECrypto extends Object implements Crypto
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CertificateFactory
certFactory()
Cipher
cipher(String algorithm)
Mac
hmac(String algorithm, byte[] key)
Mac
hmacSHA1(byte[] key)
Mac
hmacSHA256(byte[] key)
KeyFactory
rsaKeyFactory()
KeyPairGenerator
rsaKeyPairGenerator()
-
-
-
Constructor Detail
-
JCECrypto
@Inject public JCECrypto() throws NoSuchAlgorithmException, CertificateException
-
JCECrypto
public JCECrypto(@Nullable Provider provider) throws NoSuchAlgorithmException, CertificateException
-
-
Method Detail
-
hmac
public Mac hmac(String algorithm, byte[] key) throws NoSuchAlgorithmException, InvalidKeyException
- Specified by:
hmac
in interfaceCrypto
- Throws:
NoSuchAlgorithmException
InvalidKeyException
-
cipher
public Cipher cipher(String algorithm) throws NoSuchAlgorithmException, NoSuchPaddingException
- Specified by:
cipher
in interfaceCrypto
- Throws:
NoSuchAlgorithmException
NoSuchPaddingException
-
hmacSHA1
public Mac hmacSHA1(byte[] key) throws InvalidKeyException
- Specified by:
hmacSHA1
in interfaceCrypto
- Throws:
InvalidKeyException
-
hmacSHA256
public Mac hmacSHA256(byte[] key) throws InvalidKeyException
- Specified by:
hmacSHA256
in interfaceCrypto
- Throws:
InvalidKeyException
-
certFactory
public CertificateFactory certFactory()
- Specified by:
certFactory
in interfaceCrypto
-
rsaKeyFactory
public KeyFactory rsaKeyFactory()
- Specified by:
rsaKeyFactory
in interfaceCrypto
-
rsaKeyPairGenerator
public KeyPairGenerator rsaKeyPairGenerator()
- Specified by:
rsaKeyPairGenerator
in interfaceCrypto
-
-