Source for gnu.java.security.provider.Gnu

   1: /* Gnu.java --- Gnu provider main class
   2:    Copyright (C) 1999, 2002, 2003, 2005 Free Software Foundation, Inc.
   3: 
   4: This file is part of GNU Classpath.
   5: 
   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.
  10: 
  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.
  15: 
  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., 51 Franklin Street, Fifth Floor, Boston, MA
  19: 02110-1301 USA.
  20: 
  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.
  25: 
  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. */
  37: 
  38: 
  39: package gnu.java.security.provider;
  40: 
  41: import java.security.AccessController;
  42: import java.security.PrivilegedAction;
  43: import java.security.Provider;
  44: 
  45: public final class Gnu
  46:     extends Provider
  47: {
  48:   public Gnu()
  49:   {
  50:     super("GNU", 1.0,
  51:           "GNU provider v1.0 implementing SHA-1, MD5, DSA, RSA, X.509 "
  52:           + "Certificates and CRLs, PKIX certificate path validators, "
  53:           + "Collection cert stores, Diffie-Hellman key agreement and "
  54:           + "key pair generator");
  55:     AccessController.doPrivileged (new PrivilegedAction()
  56:     {
  57:       public Object run()
  58:       {
  59:         // Note that all implementation class names are referenced by using
  60:         // Class.getName(). That way when we staticly link the Gnu provider
  61:         // we automatically get all the implementation classes.
  62: 
  63:         // Signature
  64:         put("Signature.SHA160withDSS",
  65:             gnu.java.security.jce.sig.SHA160withDSS.class.getName());
  66:         put("Alg.Alias.Signature.SHA1withDSA", "SHA160withDSS");
  67:         put("Alg.Alias.Signature.DSS", "SHA160withDSS");
  68:         put("Alg.Alias.Signature.DSA", "SHA160withDSS");
  69:         put("Alg.Alias.Signature.SHAwithDSA", "SHA160withDSS");
  70:         put("Alg.Alias.Signature.DSAwithSHA", "SHA160withDSS");
  71:         put("Alg.Alias.Signature.DSAwithSHA1", "SHA160withDSS");
  72:         put("Alg.Alias.Signature.SHA/DSA", "SHA160withDSS");
  73:         put("Alg.Alias.Signature.SHA-1/DSA", "SHA160withDSS");
  74:         put("Alg.Alias.Signature.SHA1/DSA", "SHA160withDSS");
  75:         put("Alg.Alias.Signature.OID.1.2.840.10040.4.3", "SHA160withDSS");
  76:         put("Alg.Alias.Signature.1.2.840.10040.4.3", "SHA160withDSS");
  77:         put("Alg.Alias.Signature.1.3.14.3.2.13", "SHA160withDSS");
  78:         put("Alg.Alias.Signature.1.3.14.3.2.27", "SHA160withDSS");
  79: 
  80:         put("Signature.MD2withRSA",
  81:             gnu.java.security.jce.sig.MD2withRSA.class.getName());
  82:         put("Signature.MD2withRSA ImplementedIn", "Software");
  83:         put("Alg.Alias.Signature.md2WithRSAEncryption", "MD2withRSA");
  84:         put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.2", "MD2withRSA");
  85:         put("Alg.Alias.Signature.1.2.840.113549.1.1.2", "MD2withRSA");
  86: 
  87:         put("Signature.MD5withRSA",
  88:             gnu.java.security.jce.sig.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");
  93:         put("Alg.Alias.Signature.RSA", "MD5withRSA");
  94: 
  95:         put("Signature.SHA160withRSA",
  96:             gnu.java.security.jce.sig.SHA160withRSA.class.getName());
  97:         put("Signature.SHA160withRSA ImplementedIn", "Software");
  98:         put("Alg.Alias.Signature.sha-1WithRSAEncryption", "SHA160withRSA");
  99:         put("Alg.Alias.Signature.sha-160WithRSAEncryption", "SHA160withRSA");
 100:         put("Alg.Alias.Signature.sha1WithRSAEncryption", "SHA160withRSA");
 101:         put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.5", "SHA160withRSA");
 102:         put("Alg.Alias.Signature.1.2.840.113549.1.1.5", "SHA160withRSA");
 103:         put("Alg.Alias.Signature.SHA1withRSA", "SHA160withRSA");
 104: 
 105:         put("Signature.SHA256withRSA",
 106:             gnu.java.security.jce.sig.SHA256withRSA.class.getName());
 107:         put("Signature.SHA160withRSA ImplementedIn", "Software");
 108:         put("Alg.Alias.Signature.sha256WithRSAEncryption", "SHA256withRSA");
 109:         put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.11", "SHA256withRSA");
 110:         put("Alg.Alias.Signature.1.2.840.113549.1.1.11", "SHA256withRSA");
 111: 
 112:         put("Signature.SHA384withRSA",
 113:             gnu.java.security.jce.sig.SHA384withRSA.class.getName());
 114:         put("Signature.SHA160withRSA ImplementedIn", "Software");
 115:         put("Alg.Alias.Signature.sha384WithRSAEncryption", "SHA384withRSA");
 116:         put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.12", "SHA384withRSA");
 117:         put("Alg.Alias.Signature.1.2.840.113549.1.1.12", "SHA384withRSA");
 118: 
 119:         put("Signature.SHA512withRSA",
 120:             gnu.java.security.jce.sig.SHA512withRSA.class.getName());
 121:         put("Signature.SHA160withRSA ImplementedIn", "Software");
 122:         put("Alg.Alias.Signature.sha512WithRSAEncryption", "SHA512withRSA");
 123:         put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.13", "SHA512withRSA");
 124:         put("Alg.Alias.Signature.1.2.840.113549.1.1.13", "SHA512withRSA");
 125: 
 126:         put("Signature.DSS/RAW",
 127:             gnu.java.security.jce.sig.DSSRawSignatureSpi.class.getName());
 128:         put("Signature.DSS/RAW KeySize", "1024");
 129:         put("Signature.DSS/RAW ImplementedIn", "Software");
 130: 
 131:         put("Signature.RSA-PSS/RAW",
 132:             gnu.java.security.jce.sig.RSAPSSRawSignatureSpi.class.getName());
 133:         put("Signature.RSA-PSS/RAW KeySize", "1024");
 134:         put("Signature.RSA-PSS/RAW ImplementedIn", "Software");
 135: 
 136:         // Key Pair Generator
 137:         put("KeyPairGenerator.DSS",
 138:             gnu.java.security.jce.sig.DSSKeyPairGeneratorSpi.class.getName());
 139:         put("KeyPairGenerator.DSS KeySize", "1024");
 140:         put("KeyPairGenerator.DSS ImplementedIn", "Software");
 141:         put("Alg.Alias.KeyPairGenerator.DSA", "DSS");
 142:         put("Alg.Alias.KeyPairGenerator.OID.1.2.840.10040.4.1", "DSS");
 143:         put("Alg.Alias.KeyPairGenerator.1.2.840.10040.4.1", "DSS");
 144:         put("Alg.Alias.KeyPairGenerator.1.3.14.3.2.12", "DSS");
 145: 
 146:         put("KeyPairGenerator.RSA",
 147:             gnu.java.security.jce.sig.RSAKeyPairGeneratorSpi.class.getName());
 148:         put("KeyPairGenerator.RSA KeySize", "1024");
 149:         put("KeyPairGenerator.RSA ImplementedIn", "Software");
 150: 
 151:         // Key Factory
 152:         put("KeyFactory.DSS",
 153:             gnu.java.security.jce.sig.DSSKeyFactory.class.getName());
 154:         put("Alg.Alias.KeyFactory.DSA", "DSS");
 155:         put("Alg.Alias.KeyFactory.OID.1.2.840.10040.4.1", "DSS");
 156:         put("Alg.Alias.KeyFactory.1.2.840.10040.4.1", "DSS");
 157:         put("Alg.Alias.KeyFactory.1.3.14.3.2.12", "DSS");
 158: 
 159:         put("KeyFactory.RSA",
 160:             gnu.java.security.jce.sig.RSAKeyFactory.class.getName());
 161: 
 162:         put("KeyFactory.Encoded",
 163:             gnu.java.security.jce.sig.EncodedKeyFactory.class.getName());
 164:         put("KeyFactory.Encoded ImplementedIn", "Software");
 165:         put("Alg.Alias.KeyFactory.X.509", "Encoded");
 166:         put("Alg.Alias.KeyFactory.X509", "Encoded");
 167:         put("Alg.Alias.KeyFactory.PKCS#8", "Encoded");
 168:         put("Alg.Alias.KeyFactory.PKCS8", "Encoded");
 169: 
 170:         put("MessageDigest.HAVAL",
 171:             gnu.java.security.jce.hash.HavalSpi.class.getName());
 172:         put("MessageDigest.HAVAL ImplementedIn", "Software");
 173:         put("MessageDigest.MD2",
 174:             gnu.java.security.jce.hash.MD2Spi.class.getName());
 175:         put("MessageDigest.MD2 ImplementedIn", "Software");
 176:         put("MessageDigest.MD4",
 177:             gnu.java.security.jce.hash.MD4Spi.class.getName());
 178:         put("MessageDigest.MD4 ImplementedIn", "Software");
 179:         put("MessageDigest.MD5",
 180:             gnu.java.security.jce.hash.MD5Spi.class.getName());
 181:         put("MessageDigest.MD5 ImplementedIn", "Software");
 182:         put("MessageDigest.RIPEMD128",
 183:             gnu.java.security.jce.hash.RipeMD128Spi.class.getName());
 184:         put("MessageDigest.RIPEMD128 ImplementedIn", "Software");
 185:         put("MessageDigest.RIPEMD160",
 186:             gnu.java.security.jce.hash.RipeMD160Spi.class.getName());
 187:         put("MessageDigest.RIPEMD160 ImplementedIn", "Software");
 188:         put("MessageDigest.SHA-160",
 189:             gnu.java.security.jce.hash.Sha160Spi.class.getName());
 190:         put("MessageDigest.SHA-160 ImplementedIn", "Software");
 191:         put("MessageDigest.SHA-256",
 192:             gnu.java.security.jce.hash.Sha256Spi.class.getName());
 193:         put("MessageDigest.SHA-256 ImplementedIn", "Software");
 194:         put("MessageDigest.SHA-384",
 195:             gnu.java.security.jce.hash.Sha384Spi.class.getName());
 196:         put("MessageDigest.SHA-384 ImplementedIn", "Software");
 197:         put("MessageDigest.SHA-512",
 198:             gnu.java.security.jce.hash.Sha512Spi.class.getName());
 199:         put("MessageDigest.SHA-512 ImplementedIn", "Software");
 200:         put("MessageDigest.TIGER",
 201:             gnu.java.security.jce.hash.TigerSpi.class.getName());
 202:         put("MessageDigest.TIGER ImplementedIn", "Software");
 203:         put("MessageDigest.WHIRLPOOL",
 204:             gnu.java.security.jce.hash.WhirlpoolSpi.class.getName());
 205:         put("MessageDigest.WHIRLPOOL ImplementedIn", "Software");
 206: 
 207:         put("Alg.Alias.MessageDigest.SHS", "SHA-160");
 208:         put("Alg.Alias.MessageDigest.SHA", "SHA-160");
 209:         put("Alg.Alias.MessageDigest.SHA1", "SHA-160");
 210:         put("Alg.Alias.MessageDigest.SHA-1", "SHA-160");
 211:         put("Alg.Alias.MessageDigest.SHA2-256", "SHA-256");
 212:         put("Alg.Alias.MessageDigest.SHA2-384", "SHA-384");
 213:         put("Alg.Alias.MessageDigest.SHA2-512", "SHA-512");
 214:         put("Alg.Alias.MessageDigest.SHA256", "SHA-256");
 215:         put("Alg.Alias.MessageDigest.SHA384", "SHA-384");
 216:         put("Alg.Alias.MessageDigest.SHA512", "SHA-512");
 217:         put("Alg.Alias.MessageDigest.RIPEMD-160", "RIPEMD160");
 218:         put("Alg.Alias.MessageDigest.RIPEMD-128", "RIPEMD128");
 219:         put("Alg.Alias.MessageDigest.OID.1.2.840.11359.2.2", "MD2");
 220:         put("Alg.Alias.MessageDigest.1.2.840.11359.2.2", "MD2");
 221:         put("Alg.Alias.MessageDigest.OID.1.2.840.11359.2.5", "MD5");
 222:         put("Alg.Alias.MessageDigest.1.2.840.11359.2.5", "MD5");
 223:         put("Alg.Alias.MessageDigest.OID.1.3.14.3.2.26", "SHA1");
 224:         put("Alg.Alias.MessageDigest.1.3.14.3.2.26", "SHA1");
 225: 
 226:         // Algorithm Parameters
 227:         put("AlgorithmParameters.DSS",
 228:             gnu.java.security.jce.sig.DSSParameters.class.getName());
 229:         put("Alg.Alias.AlgorithmParameters.DSA", "DSS");
 230:         put("Alg.Alias.AlgorithmParameters.SHAwithDSA", "DSS");
 231:         put("Alg.Alias.AlgorithmParameters.OID.1.2.840.10040.4.3", "DSS");
 232:         put("Alg.Alias.AlgorithmParameters.1.2.840.10040.4.3", "DSS");
 233: 
 234:         // Algorithm Parameter Generator
 235:         put("AlgorithmParameterGenerator.DSA",
 236:             gnu.java.security.jce.sig.DSSParametersGenerator.class.getName());
 237:         put("Alg.Alias.AlgorithmParameterGenerator.DSA", "DSS");
 238: 
 239:         // SecureRandom
 240:         put("SecureRandom.SHA1PRNG",
 241:             gnu.java.security.jce.prng.Sha160RandomSpi.class.getName());
 242: 
 243:         put("SecureRandom.MD2PRNG",
 244:             gnu.java.security.jce.prng.MD2RandomSpi.class.getName());
 245:         put("SecureRandom.MD2PRNG ImplementedIn", "Software");
 246:         put("SecureRandom.MD4PRNG",
 247:             gnu.java.security.jce.prng.MD4RandomSpi.class.getName());
 248:         put("SecureRandom.MD4PRNG ImplementedIn", "Software");
 249:         put("SecureRandom.MD5PRNG",
 250:             gnu.java.security.jce.prng.MD5RandomSpi.class.getName());
 251:         put("SecureRandom.MD5PRNG ImplementedIn", "Software");
 252:         put("SecureRandom.RIPEMD128PRNG",
 253:             gnu.java.security.jce.prng.RipeMD128RandomSpi.class.getName());
 254:         put("SecureRandom.RIPEMD128PRNG ImplementedIn", "Software");
 255:         put("SecureRandom.RIPEMD160PRNG",
 256:             gnu.java.security.jce.prng.RipeMD160RandomSpi.class.getName());
 257:         put("SecureRandom.RIPEMD160PRNG ImplementedIn", "Software");
 258:         put("SecureRandom.SHA-160PRNG",
 259:             gnu.java.security.jce.prng.Sha160RandomSpi.class.getName());
 260:         put("SecureRandom.SHA-160PRNG ImplementedIn", "Software");
 261:         put("SecureRandom.SHA-256PRNG",
 262:             gnu.java.security.jce.prng.Sha256RandomSpi.class.getName());
 263:         put("SecureRandom.SHA-256PRNG ImplementedIn", "Software");
 264:         put("SecureRandom.SHA-384PRNG",
 265:             gnu.java.security.jce.prng.Sha384RandomSpi.class.getName());
 266:         put("SecureRandom.SHA-384PRNG ImplementedIn", "Software");
 267:         put("SecureRandom.SHA-512PRNG",
 268:             gnu.java.security.jce.prng.Sha512RandomSpi.class.getName());
 269:         put("SecureRandom.SHA-512PRNG ImplementedIn", "Software");
 270:         put("SecureRandom.TIGERPRNG",
 271:             gnu.java.security.jce.prng.TigerRandomSpi.class.getName());
 272:         put("SecureRandom.TIGERPRNG ImplementedIn", "Software");
 273:         put("SecureRandom.HAVALPRNG",
 274:             gnu.java.security.jce.prng.HavalRandomSpi.class.getName());
 275:         put("SecureRandom.HAVALPRNG ImplementedIn", "Software");
 276:         put("SecureRandom.WHIRLPOOLPRNG",
 277:             gnu.java.security.jce.prng.WhirlpoolRandomSpi.class.getName());
 278:         put("SecureRandom.WHIRLPOOLPRNG ImplementedIn", "Software");
 279: 
 280:         put("Alg.Alias.SecureRandom.SHA-1PRNG", "SHA-160PRNG");
 281:         put("Alg.Alias.SecureRandom.SHA1PRNG", "SHA-160PRNG");
 282:         put("Alg.Alias.SecureRandom.SHAPRNG", "SHA-160PRNG");
 283:         put("Alg.Alias.SecureRandom.SHA-256PRNG", "SHA-256PRNG");
 284:         put("Alg.Alias.SecureRandom.SHA-2-1PRNG", "SHA-256PRNG");
 285:         put("Alg.Alias.SecureRandom.SHA-384PRNG", "SHA-384PRNG");
 286:         put("Alg.Alias.SecureRandom.SHA-2-2PRNG", "SHA-384PRNG");
 287:         put("Alg.Alias.SecureRandom.SHA-512PRNG", "SHA-512PRNG");
 288:         put("Alg.Alias.SecureRandom.SHA-2-3PRNG", "SHA-512PRNG");
 289: 
 290:         // CertificateFactory
 291:         put("CertificateFactory.X509", X509CertificateFactory.class.getName());
 292:         put("CertificateFactory.X509 ImplementedIn", "Software");
 293:         put("Alg.Alias.CertificateFactory.X.509", "X509");
 294: 
 295:         // CertPathValidator
 296:         put("CertPathValidator.PKIX", PKIXCertPathValidatorImpl.class.getName());
 297:         put("CertPathValidator.PKIX ImplementedIn", "Software");
 298: 
 299:         // CertStore
 300:         put("CertStore.Collection", CollectionCertStoreImpl.class.getName());
 301: 
 302:         return null;
 303:       }
 304:     });
 305:   }
 306: }