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