Merge from mainline (gomp-merge-2005-02-26).
[official-gcc.git] / libjava / gnu / java / security / provider / Gnu.java
blob34f86d8bad00d52c727dc04bb7d34302483daaae
1 /* Gnu.java --- Gnu provider main class
2 Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
4 This file is part of GNU Classpath.
6 GNU Classpath is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 2, or (at your option)
9 any later version.
11 GNU Classpath is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
16 You should have received a copy of the GNU General Public License
17 along with GNU Classpath; see the file COPYING. If not, write to the
18 Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
19 02111-1307 USA.
21 Linking this library statically or dynamically with other modules is
22 making a combined work based on this library. Thus, the terms and
23 conditions of the GNU General Public License cover the whole
24 combination.
26 As a special exception, the copyright holders of this library give you
27 permission to link this library with independent modules to produce an
28 executable, regardless of the license terms of these independent
29 modules, and to copy and distribute the resulting executable under
30 terms of your choice, provided that you also meet, for each linked
31 independent module, the terms and conditions of the license of that
32 module. An independent module is a module which is not derived from
33 or based on this library. If you modify this library, you may extend
34 this exception to your version of the library, but you are not
35 obligated to do so. If you do not wish to do so, delete this
36 exception statement from your version. */
39 package gnu.java.security.provider;
41 import java.security.AccessController;
42 import java.security.PrivilegedAction;
43 import java.security.Provider;
45 public final class Gnu extends Provider
47 public Gnu()
49 super("GNU", 1.0, "GNU provider v1.0 implementing SHA-1, MD5, DSA, RSA, X.509 Certificates and CRLs, PKIX certificate path validators, Collection cert stores");
51 AccessController.doPrivileged (new PrivilegedAction()
53 public Object run()
55 // Note that all implementation class names are referenced by using
56 // Class.getName(). That way when we staticly link the Gnu provider
57 // we automatically get all the implementation classes.
59 // Signature
60 put("Signature.SHA1withDSA",
61 gnu.java.security.provider.DSASignature.class.getName());
63 put("Alg.Alias.Signature.DSS", "SHA1withDSA");
64 put("Alg.Alias.Signature.DSA", "SHA1withDSA");
65 put("Alg.Alias.Signature.SHAwithDSA", "SHA1withDSA");
66 put("Alg.Alias.Signature.DSAwithSHA", "SHA1withDSA");
67 put("Alg.Alias.Signature.DSAwithSHA1", "SHA1withDSA");
68 put("Alg.Alias.Signature.SHA/DSA", "SHA1withDSA");
69 put("Alg.Alias.Signature.SHA-1/DSA", "SHA1withDSA");
70 put("Alg.Alias.Signature.SHA1/DSA", "SHA1withDSA");
71 put("Alg.Alias.Signature.OID.1.2.840.10040.4.3", "SHA1withDSA");
72 put("Alg.Alias.Signature.1.2.840.10040.4.3", "SHA1withDSA");
73 put("Alg.Alias.Signature.1.3.14.3.2.13", "SHA1withDSA");
74 put("Alg.Alias.Signature.1.3.14.3.2.27", "SHA1withDSA");
76 put("Signature.MD2withRSA", MD2withRSA.class.getName());
77 put("Signature.MD2withRSA ImplementedIn", "Software");
78 put("Alg.Alias.Signature.md2WithRSAEncryption", "MD2withRSA");
79 put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.2", "MD2withRSA");
80 put("Alg.Alias.Signature.1.2.840.113549.1.1.2", "MD2withRSA");
82 put("Signature.MD4withRSA", MD4withRSA.class.getName());
83 put("Signature.MD4withRSA ImplementedIn", "Software");
84 put("Alg.Alias.Signature.md4WithRSAEncryption", "MD4withRSA");
85 put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.3", "MD4withRSA");
86 put("Alg.Alias.Signature.1.2.840.113549.1.1.3", "MD4withRSA");
88 put("Signature.MD5withRSA", MD5withRSA.class.getName());
89 put("Signature.MD5withRSA ImplementedIn", "Software");
90 put("Alg.Alias.Signature.md5WithRSAEncryption", "MD5withRSA");
91 put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.4", "MD5withRSA");
92 put("Alg.Alias.Signature.1.2.840.113549.1.1.4", "MD5withRSA");
94 put("Signature.SHA1withRSA", SHA1withRSA.class.getName());
95 put("Signature.SHA1withRSA ImplementedIn", "Software");
96 put("Alg.Alias.Signature.sha-1WithRSAEncryption", "SHA1withRSA");
97 put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.5", "SHA1withRSA");
98 put("Alg.Alias.Signature.1.2.840.113549.1.1.5", "SHA1withRSA");
100 // Key Pair Generator
101 put("KeyPairGenerator.DSA",
102 gnu.java.security.provider.DSAKeyPairGenerator.class.getName());
104 put("Alg.Alias.KeyPairGenerator.OID.1.2.840.10040.4.1", "DSA");
105 put("Alg.Alias.KeyPairGenerator.1.2.840.10040.4.1", "DSA");
106 put("Alg.Alias.KeyPairGenerator.1.3.14.3.2.12", "DSA");
108 // Key Factory
109 put("KeyFactory.DSA",
110 gnu.java.security.provider.DSAKeyFactory.class.getName());
112 put("KeyFactory.Encoded", EncodedKeyFactory.class.getName());
113 put("KeyFactory.Encoded ImplementedIn", "Software");
114 put("Alg.Alias.KeyFactory.X.509", "Encoded");
115 put("Alg.Alias.KeyFactory.X509", "Encoded");
116 put("Alg.Alias.KeyFactory.PKCS#8", "Encoded");
117 put("Alg.Alias.KeyFactory.PKCS8", "Encoded");
119 put("KeyFactory.RSA", RSAKeyFactory.class.getName());
121 put("Alg.Alias.KeyFactory.OID.1.2.840.10040.4.1", "DSA");
122 put("Alg.Alias.KeyFactory.1.2.840.10040.4.1", "DSA");
123 put("Alg.Alias.KeyFactory.1.3.14.3.2.12", "DSA");
125 // Message Digests
126 put("MessageDigest.SHA", gnu.java.security.provider.SHA.class.getName());
127 put("MessageDigest.MD5", gnu.java.security.provider.MD5.class.getName());
129 // Format "Alias", "Actual Name"
130 put("Alg.Alias.MessageDigest.SHA1", "SHA");
131 put("Alg.Alias.MessageDigest.SHA-1", "SHA");
132 put("Alg.Alias.MessageDigest.SHA-160", "SHA");
134 // Algorithm Parameters
135 put("AlgorithmParameters.DSA",
136 gnu.java.security.provider.DSAParameters.class.getName());
138 put("Alg.Alias.AlgorithmParameters.DSS", "DSA");
139 put("Alg.Alias.AlgorithmParameters.SHAwithDSA", "DSA");
140 put("Alg.Alias.AlgorithmParameters.OID.1.2.840.10040.4.3", "DSA");
141 put("Alg.Alias.AlgorithmParameters.1.2.840.10040.4.3", "DSA");
143 // Algorithm Parameter Generator
144 put("AlgorithmParameterGenerator.DSA",
145 gnu.java.security.provider.DSAParameterGenerator.class.getName());
147 // SecureRandom
148 put("SecureRandom.SHA1PRNG",
149 gnu.java.security.provider.SHA1PRNG.class.getName());
151 // CertificateFactory
152 put("CertificateFactory.X509", X509CertificateFactory.class.getName());
154 put("CertificateFactory.X509 ImplementedIn", "Software");
155 put("Alg.Alias.CertificateFactory.X.509", "X509");
157 // CertPathValidator
158 put("CertPathValidator.PKIX", PKIXCertPathValidatorImpl.class.getName());
159 put("CertPathValidator.PKIX ImplementedIn", "Software");
161 // CertStore
162 put("CertStore.Collection", CollectionCertStoreImpl.class.getName());
164 return null;