DefaultJcaJceHelper.java revision e1142c149e244797ce73b0e7fad40816e447a817
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;
18import javax.crypto.SecretKeyFactory;
19
20public class DefaultJcaJceHelper
21    implements JcaJceHelper
22{
23    public Cipher createCipher(
24        String algorithm)
25        throws NoSuchAlgorithmException, NoSuchPaddingException
26    {
27        return Cipher.getInstance(algorithm);
28    }
29
30    public Mac createMac(String algorithm)
31        throws NoSuchAlgorithmException
32    {
33        return Mac.getInstance(algorithm);
34    }
35
36    public KeyAgreement createKeyAgreement(String algorithm)
37        throws NoSuchAlgorithmException
38    {
39        return KeyAgreement.getInstance(algorithm);
40    }
41
42    public AlgorithmParameterGenerator createAlgorithmParameterGenerator(String algorithm)
43        throws NoSuchAlgorithmException
44    {
45        return AlgorithmParameterGenerator.getInstance(algorithm);
46    }
47
48    public AlgorithmParameters createAlgorithmParameters(String algorithm)
49        throws NoSuchAlgorithmException
50    {
51        return AlgorithmParameters.getInstance(algorithm);
52    }
53
54    public KeyGenerator createKeyGenerator(String algorithm)
55        throws NoSuchAlgorithmException
56    {
57        return KeyGenerator.getInstance(algorithm);
58    }
59
60    public KeyFactory createKeyFactory(String algorithm)
61        throws NoSuchAlgorithmException
62    {
63        return KeyFactory.getInstance(algorithm);
64    }
65
66    public SecretKeyFactory createSecretKeyFactory(String algorithm)
67        throws NoSuchAlgorithmException
68    {
69        return SecretKeyFactory.getInstance(algorithm);
70    }
71
72    public KeyPairGenerator createKeyPairGenerator(String algorithm)
73        throws NoSuchAlgorithmException
74    {
75        return KeyPairGenerator.getInstance(algorithm);
76    }
77
78    public MessageDigest createDigest(String algorithm)
79        throws NoSuchAlgorithmException
80    {
81        return MessageDigest.getInstance(algorithm);
82    }
83
84    public Signature createSignature(String algorithm)
85        throws NoSuchAlgorithmException
86    {
87        return Signature.getInstance(algorithm);
88    }
89
90    public CertificateFactory createCertificateFactory(String algorithm)
91        throws NoSuchAlgorithmException, CertificateException
92    {
93        return CertificateFactory.getInstance(algorithm);
94    }
95}
96