1package org.bouncycastle.jcajce;
2
3import java.security.AlgorithmParameterGenerator;
4import java.security.AlgorithmParameters;
5import java.security.KeyFactory;
6import java.security.KeyPairGenerator;
7import java.security.MessageDigest;
8import java.security.NoSuchAlgorithmException;
9import java.security.Signature;
10import java.security.cert.CertificateException;
11import java.security.cert.CertificateFactory;
12
13import javax.crypto.Cipher;
14import javax.crypto.KeyAgreement;
15import javax.crypto.KeyGenerator;
16import javax.crypto.Mac;
17import javax.crypto.NoSuchPaddingException;
18
19public class DefaultJcaJceHelper
20    implements JcaJceHelper
21{
22    public Cipher createCipher(
23        String algorithm)
24        throws NoSuchAlgorithmException, NoSuchPaddingException
25    {
26        return Cipher.getInstance(algorithm);
27    }
28
29    public Mac createMac(String algorithm)
30        throws NoSuchAlgorithmException
31    {
32        return Mac.getInstance(algorithm);
33    }
34
35    public KeyAgreement createKeyAgreement(String algorithm)
36        throws NoSuchAlgorithmException
37    {
38        return KeyAgreement.getInstance(algorithm);
39    }
40
41    public AlgorithmParameterGenerator createAlgorithmParameterGenerator(String algorithm)
42        throws NoSuchAlgorithmException
43    {
44        return AlgorithmParameterGenerator.getInstance(algorithm);
45    }
46
47    public AlgorithmParameters createAlgorithmParameters(String algorithm)
48        throws NoSuchAlgorithmException
49    {
50        return AlgorithmParameters.getInstance(algorithm);
51    }
52
53    public KeyGenerator createKeyGenerator(String algorithm)
54        throws NoSuchAlgorithmException
55    {
56        return KeyGenerator.getInstance(algorithm);
57    }
58
59    public KeyFactory createKeyFactory(String algorithm)
60        throws NoSuchAlgorithmException
61    {
62        return KeyFactory.getInstance(algorithm);
63    }
64
65    public KeyPairGenerator createKeyPairGenerator(String algorithm)
66        throws NoSuchAlgorithmException
67    {
68        return KeyPairGenerator.getInstance(algorithm);
69    }
70
71    public MessageDigest createDigest(String algorithm)
72        throws NoSuchAlgorithmException
73    {
74        return MessageDigest.getInstance(algorithm);
75    }
76
77    public Signature createSignature(String algorithm)
78        throws NoSuchAlgorithmException
79    {
80        return Signature.getInstance(algorithm);
81    }
82
83    public CertificateFactory createCertificateFactory(String algorithm)
84        throws NoSuchAlgorithmException, CertificateException
85    {
86        return CertificateFactory.getInstance(algorithm);
87    }
88}
89