@Singleton public class JCECrypto extends Object implements Crypto
Constructor and Description |
---|
JCECrypto() |
JCECrypto(Provider provider) |
Modifier and Type | Method and 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() |
@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 Cipher cipher(String algorithm) throws NoSuchAlgorithmException, NoSuchPaddingException
cipher
in interface Crypto
NoSuchAlgorithmException
NoSuchPaddingException
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-2016 The Apache Software Foundation. All Rights Reserved.