src/windows/classes/sun/security/mscapi/SunMSCAPI.java

Print this page


   1 /*
   2  * Copyright (c) 2005, 2011, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  64         // doPrivileged() call at the end to transfer the contents
  65         final Map map = (System.getSecurityManager() == null)
  66                         ? (Map)this : new HashMap();
  67 
  68         /*
  69          * Secure random
  70          */
  71         map.put("SecureRandom.Windows-PRNG", "sun.security.mscapi.PRNG");
  72 
  73         /*
  74          * Key store
  75          */
  76         map.put("KeyStore.Windows-MY", "sun.security.mscapi.KeyStore$MY");
  77         map.put("KeyStore.Windows-ROOT", "sun.security.mscapi.KeyStore$ROOT");
  78 
  79         /*
  80          * Signature engines
  81          */
  82         // NONEwithRSA must be supplied with a pre-computed message digest.
  83         // Only the following digest algorithms are supported: MD5, SHA-1,
  84         // SHA-256, SHA-384, SHA-512 and a special-purpose digest algorithm
  85         // which is a concatenation of SHA-1 and MD5 digests.
  86         map.put("Signature.NONEwithRSA",
  87             "sun.security.mscapi.RSASignature$Raw");
  88         map.put("Signature.SHA1withRSA",
  89             "sun.security.mscapi.RSASignature$SHA1");




  90         map.put("Signature.SHA256withRSA",
  91             "sun.security.mscapi.RSASignature$SHA256");


  92         map.put("Signature.SHA384withRSA",
  93             "sun.security.mscapi.RSASignature$SHA384");



  94         map.put("Signature.SHA512withRSA",
  95             "sun.security.mscapi.RSASignature$SHA512");



  96         map.put("Signature.MD5withRSA",
  97             "sun.security.mscapi.RSASignature$MD5");
  98         map.put("Signature.MD2withRSA",
  99             "sun.security.mscapi.RSASignature$MD2");
 100 
 101         // supported key classes
 102         map.put("Signature.NONEwithRSA SupportedKeyClasses",
 103             "sun.security.mscapi.Key");
 104         map.put("Signature.SHA1withRSA SupportedKeyClasses",


 105             "sun.security.mscapi.Key");
 106         map.put("Signature.SHA256withRSA SupportedKeyClasses",
 107             "sun.security.mscapi.Key");
 108         map.put("Signature.SHA384withRSA SupportedKeyClasses",
 109             "sun.security.mscapi.Key");
 110         map.put("Signature.SHA512withRSA SupportedKeyClasses",
 111             "sun.security.mscapi.Key");
 112         map.put("Signature.MD5withRSA SupportedKeyClasses",
 113             "sun.security.mscapi.Key");
 114         map.put("Signature.MD2withRSA SupportedKeyClasses",
 115             "sun.security.mscapi.Key");
 116 
 117         /*
 118          * Key Pair Generator engines
 119          */
 120         map.put("KeyPairGenerator.RSA",
 121             "sun.security.mscapi.RSAKeyPairGenerator");
 122         map.put("KeyPairGenerator.RSA KeySize", "1024");
 123 
 124         /*
   1 /*
   2  * Copyright (c) 2005, 2012, Oracle and/or its affiliates. All rights reserved.
   3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4  *
   5  * This code is free software; you can redistribute it and/or modify it
   6  * under the terms of the GNU General Public License version 2 only, as
   7  * published by the Free Software Foundation.  Oracle designates this
   8  * particular file as subject to the "Classpath" exception as provided
   9  * by Oracle in the LICENSE file that accompanied this code.
  10  *
  11  * This code is distributed in the hope that it will be useful, but WITHOUT
  12  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  13  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  14  * version 2 for more details (a copy is included in the LICENSE file that
  15  * accompanied this code).
  16  *
  17  * You should have received a copy of the GNU General Public License version
  18  * 2 along with this work; if not, write to the Free Software Foundation,
  19  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  20  *
  21  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  22  * or visit www.oracle.com if you need additional information or have any


  64         // doPrivileged() call at the end to transfer the contents
  65         final Map map = (System.getSecurityManager() == null)
  66                         ? (Map)this : new HashMap();
  67 
  68         /*
  69          * Secure random
  70          */
  71         map.put("SecureRandom.Windows-PRNG", "sun.security.mscapi.PRNG");
  72 
  73         /*
  74          * Key store
  75          */
  76         map.put("KeyStore.Windows-MY", "sun.security.mscapi.KeyStore$MY");
  77         map.put("KeyStore.Windows-ROOT", "sun.security.mscapi.KeyStore$ROOT");
  78 
  79         /*
  80          * Signature engines
  81          */
  82         // NONEwithRSA must be supplied with a pre-computed message digest.
  83         // Only the following digest algorithms are supported: MD5, SHA-1,
  84         // SHA-224, SHA-256, SHA-384, SHA-512 and a special-purpose digest
  85         // algorithm which is a concatenation of SHA-1 and MD5 digests.
  86         map.put("Signature.NONEwithRSA",
  87             "sun.security.mscapi.RSASignature$Raw");
  88         map.put("Signature.SHA1withRSA",
  89             "sun.security.mscapi.RSASignature$SHA1");
  90         map.put("Signature.SHA224withRSA",
  91             "sun.security.mscapi.RSASignature$SHA224");
  92         map.put("Alg.Alias.Signature.1.2.840.113549.1.1.14",     "SHA224withRSA");
  93         map.put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.14", "SHA224withRSA");
  94         map.put("Signature.SHA256withRSA",
  95             "sun.security.mscapi.RSASignature$SHA256");
  96         map.put("Alg.Alias.Signature.1.2.840.113549.1.1.11",     "SHA256withRSA");
  97         map.put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.11", "SHA256withRSA");
  98         map.put("Signature.SHA384withRSA",
  99             "sun.security.mscapi.RSASignature$SHA384");
 100         map.put("Alg.Alias.Signature.1.2.840.113549.1.1.12",     "SHA384withRSA");
 101         map.put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.12", "SHA384withRSA");
 102 
 103         map.put("Signature.SHA512withRSA",
 104             "sun.security.mscapi.RSASignature$SHA512");
 105         map.put("Alg.Alias.Signature.1.2.840.113549.1.1.13",     "SHA512withRSA");
 106         map.put("Alg.Alias.Signature.OID.1.2.840.113549.1.1.13", "SHA512withRSA");
 107 
 108         map.put("Signature.MD5withRSA",
 109             "sun.security.mscapi.RSASignature$MD5");
 110         map.put("Signature.MD2withRSA",
 111             "sun.security.mscapi.RSASignature$MD2");
 112 
 113         // supported key classes
 114         map.put("Signature.NONEwithRSA SupportedKeyClasses",
 115             "sun.security.mscapi.Key");
 116         map.put("Signature.SHA1withRSA SupportedKeyClasses",
 117             "sun.security.mscapi.Key");
 118         map.put("Signature.SHA224withRSA SupportedKeyClasses",
 119             "sun.security.mscapi.Key");
 120         map.put("Signature.SHA256withRSA SupportedKeyClasses",
 121             "sun.security.mscapi.Key");
 122         map.put("Signature.SHA384withRSA SupportedKeyClasses",
 123             "sun.security.mscapi.Key");
 124         map.put("Signature.SHA512withRSA SupportedKeyClasses",
 125             "sun.security.mscapi.Key");
 126         map.put("Signature.MD5withRSA SupportedKeyClasses",
 127             "sun.security.mscapi.Key");
 128         map.put("Signature.MD2withRSA SupportedKeyClasses",
 129             "sun.security.mscapi.Key");
 130 
 131         /*
 132          * Key Pair Generator engines
 133          */
 134         map.put("KeyPairGenerator.RSA",
 135             "sun.security.mscapi.RSAKeyPairGenerator");
 136         map.put("KeyPairGenerator.RSA KeySize", "1024");
 137 
 138         /*