1 package org.bouncycastle.jcajce.util; 2 3 import java.security.AlgorithmParameterGenerator; 4 import java.security.AlgorithmParameters; 5 import java.security.KeyFactory; 6 import java.security.KeyPairGenerator; 7 import java.security.MessageDigest; 8 import java.security.NoSuchAlgorithmException; 9 import java.security.NoSuchProviderException; 10 import java.security.SecureRandom; 11 import java.security.Signature; 12 import java.security.cert.CertificateException; 13 import java.security.cert.CertificateFactory; 14 15 import javax.crypto.Cipher; 16 import javax.crypto.KeyAgreement; 17 import javax.crypto.KeyGenerator; 18 import javax.crypto.Mac; 19 import javax.crypto.NoSuchPaddingException; 20 import javax.crypto.SecretKeyFactory; 21 22 /** 23 * Factory interface for instantiating JCA/JCE primitives. 24 */ 25 public interface JcaJceHelper 26 { createCipher( String algorithm)27 Cipher createCipher( 28 String algorithm) 29 throws NoSuchAlgorithmException, NoSuchPaddingException, NoSuchProviderException; 30 createMac(String algorithm)31 Mac createMac(String algorithm) 32 throws NoSuchAlgorithmException, NoSuchProviderException; 33 createKeyAgreement(String algorithm)34 KeyAgreement createKeyAgreement(String algorithm) 35 throws NoSuchAlgorithmException, NoSuchProviderException; 36 createAlgorithmParameterGenerator(String algorithm)37 AlgorithmParameterGenerator createAlgorithmParameterGenerator(String algorithm) 38 throws NoSuchAlgorithmException, NoSuchProviderException; 39 createAlgorithmParameters(String algorithm)40 AlgorithmParameters createAlgorithmParameters(String algorithm) 41 throws NoSuchAlgorithmException, NoSuchProviderException; 42 createKeyGenerator(String algorithm)43 KeyGenerator createKeyGenerator(String algorithm) 44 throws NoSuchAlgorithmException, NoSuchProviderException; 45 createKeyFactory(String algorithm)46 KeyFactory createKeyFactory(String algorithm) 47 throws NoSuchAlgorithmException, NoSuchProviderException; 48 createSecretKeyFactory(String algorithm)49 SecretKeyFactory createSecretKeyFactory(String algorithm) 50 throws NoSuchAlgorithmException, NoSuchProviderException; 51 createKeyPairGenerator(String algorithm)52 KeyPairGenerator createKeyPairGenerator(String algorithm) 53 throws NoSuchAlgorithmException, NoSuchProviderException; 54 createDigest(String algorithm)55 MessageDigest createDigest(String algorithm) 56 throws NoSuchAlgorithmException, NoSuchProviderException; 57 createSignature(String algorithm)58 Signature createSignature(String algorithm) 59 throws NoSuchAlgorithmException, NoSuchProviderException; 60 createCertificateFactory(String algorithm)61 CertificateFactory createCertificateFactory(String algorithm) 62 throws NoSuchProviderException, CertificateException; 63 createSecureRandom(String algorithm)64 SecureRandom createSecureRandom(String algorithm) 65 throws NoSuchAlgorithmException, NoSuchProviderException; 66 } 67