src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/SunMSCAPI.java
author lana
Thu, 25 Jan 2018 20:56:49 +0000
changeset 48708 46a2e41ebe59
parent 47216 71c04702a3d5
child 50715 46492a773912
permissions -rw-r--r--
Added tag jdk-10+41 for changeset 3eae36c6baa5
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
36249
8b92e4bedbd4 8138653: Default key sizes for the AlgorithmParameterGenerator and KeyPairGenerator implementations should be upgraded
mullan
parents: 33991
diff changeset
     2
 * Copyright (c) 2005, 2016, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3353
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3353
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    20
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3353
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3353
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 3353
diff changeset
    23
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
package sun.security.mscapi;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
import java.security.AccessController;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
import java.security.PrivilegedAction;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
import java.security.Provider;
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    31
import java.security.NoSuchAlgorithmException;
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    32
import java.security.InvalidParameterException;
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    33
import java.security.ProviderException;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    34
import java.util.HashMap;
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    35
import java.util.Arrays;
42161
5b0b84715c06 7004967: SecureRandom should be more explicit about threading
weijun
parents: 40416
diff changeset
    36
import java.util.Map;
5b0b84715c06 7004967: SecureRandom should be more explicit about threading
weijun
parents: 40416
diff changeset
    37
40416
5d91b2fd668c 8130181: Deprecate java.security.Provider(String, double, String), add Provider(Strin
valeriep
parents: 36249
diff changeset
    38
import static sun.security.util.SecurityConstants.PROVIDER_VER;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 * A Cryptographic Service Provider for the Microsoft Crypto API.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
public final class SunMSCAPI extends Provider {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
    private static final long serialVersionUID = 8622598936488630849L; //TODO
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
    private static final String INFO = "Sun's Microsoft Crypto API provider";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
90ce3da70b43 Initial load
duke
parents:
diff changeset
    52
    static {
51
6fe31bc95bbc 6600143: Remove another 450 unnecessary casts
martin
parents: 2
diff changeset
    53
        AccessController.doPrivileged(new PrivilegedAction<Void>() {
6fe31bc95bbc 6600143: Remove another 450 unnecessary casts
martin
parents: 2
diff changeset
    54
            public Void run() {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
                System.loadLibrary("sunmscapi");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
                return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
        });
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    60
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    61
    private static final class ProviderService extends Provider.Service {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    62
        ProviderService(Provider p, String type, String algo, String cn) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    63
            super(p, type, algo, cn, null, null);
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    64
        }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    65
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    66
        ProviderService(Provider p, String type, String algo, String cn,
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    67
            String[] aliases, HashMap<String, String> attrs) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    68
            super(p, type, algo, cn,
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    69
                  (aliases == null? null : Arrays.asList(aliases)), attrs);
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    70
        }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    71
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    72
        @Override
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    73
        public Object newInstance(Object ctrParamObj)
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    74
            throws NoSuchAlgorithmException {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    75
            String type = getType();
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    76
            if (ctrParamObj != null) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    77
                throw new InvalidParameterException
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    78
                    ("constructorParameter not used with " + type +
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    79
                     " engines");
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    80
            }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    81
            String algo = getAlgorithm();
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    82
            try {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    83
                if (type.equals("SecureRandom")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    84
                    if (algo.equals("Windows-PRNG")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    85
                        return new PRNG();
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    86
                    }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    87
                } else if (type.equals("KeyStore")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    88
                    if (algo.equals("Windows-MY")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    89
                        return new KeyStore.MY();
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    90
                    } else if (algo.equals("Windows-ROOT")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    91
                        return new KeyStore.ROOT();
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    92
                    }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    93
                } else if (type.equals("Signature")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    94
                    if (algo.equals("NONEwithRSA")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    95
                        return new RSASignature.Raw();
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    96
                    } else if (algo.equals("SHA1withRSA")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    97
                        return new RSASignature.SHA1();
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    98
                    } else if (algo.equals("SHA256withRSA")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    99
                        return new RSASignature.SHA256();
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   100
                    } else if (algo.equals("SHA384withRSA")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   101
                        return new RSASignature.SHA384();
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   102
                    } else if (algo.equals("SHA512withRSA")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   103
                        return new RSASignature.SHA512();
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   104
                    } else if (algo.equals("MD5withRSA")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   105
                        return new RSASignature.MD5();
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   106
                    } else if (algo.equals("MD2withRSA")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   107
                        return new RSASignature.MD2();
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   108
                    }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   109
                } else if (type.equals("KeyPairGenerator")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   110
                    if (algo.equals("RSA")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   111
                        return new RSAKeyPairGenerator();
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   112
                    }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   113
                } else if (type.equals("Cipher")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   114
                    if (algo.equals("RSA") ||
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   115
                        algo.equals("RSA/ECB/PKCS1Padding")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   116
                        return new RSACipher();
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   117
                    }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   118
                }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   119
            } catch (Exception ex) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   120
                throw new NoSuchAlgorithmException
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   121
                    ("Error constructing " + type + " for " +
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   122
                    algo + " using SunMSCAPI", ex);
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   123
            }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   124
            throw new ProviderException("No impl for " + algo +
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   125
                " " + type);
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   126
        }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   127
    }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   128
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   129
    public SunMSCAPI() {
40416
5d91b2fd668c 8130181: Deprecate java.security.Provider(String, double, String), add Provider(Strin
valeriep
parents: 36249
diff changeset
   130
        super("SunMSCAPI", PROVIDER_VER, INFO);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   132
        final Provider p = this;
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   133
        AccessController.doPrivileged(new PrivilegedAction<Void>() {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   134
            public Void run() {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   135
                /*
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   136
                 * Secure random
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   137
                 */
42161
5b0b84715c06 7004967: SecureRandom should be more explicit about threading
weijun
parents: 40416
diff changeset
   138
                HashMap<String, String> srattrs = new HashMap<>(1);
5b0b84715c06 7004967: SecureRandom should be more explicit about threading
weijun
parents: 40416
diff changeset
   139
                srattrs.put("ThreadSafe", "true");
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   140
                putService(new ProviderService(p, "SecureRandom",
42161
5b0b84715c06 7004967: SecureRandom should be more explicit about threading
weijun
parents: 40416
diff changeset
   141
                           "Windows-PRNG", "sun.security.mscapi.PRNG",
5b0b84715c06 7004967: SecureRandom should be more explicit about threading
weijun
parents: 40416
diff changeset
   142
                           null, srattrs));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   144
                /*
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   145
                 * Key store
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   146
                 */
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   147
                putService(new ProviderService(p, "KeyStore",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   148
                           "Windows-MY", "sun.security.mscapi.KeyStore$MY"));
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   149
                putService(new ProviderService(p, "KeyStore",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   150
                           "Windows-ROOT", "sun.security.mscapi.KeyStore$ROOT"));
12685
8a448b5b9006 4963723: Implement SHA-224
valeriep
parents: 10336
diff changeset
   151
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   152
                /*
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   153
                 * Signature engines
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   154
                 */
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   155
                HashMap<String, String> attrs = new HashMap<>(1);
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   156
                attrs.put("SupportedKeyClasses", "sun.security.mscapi.Key");
12685
8a448b5b9006 4963723: Implement SHA-224
valeriep
parents: 10336
diff changeset
   157
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   158
                // NONEwithRSA must be supplied with a pre-computed message digest.
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   159
                // Only the following digest algorithms are supported: MD5, SHA-1,
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   160
                // SHA-256, SHA-384, SHA-512 and a special-purpose digest
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   161
                // algorithm which is a concatenation of SHA-1 and MD5 digests.
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   162
                putService(new ProviderService(p, "Signature",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   163
                           "NONEwithRSA", "sun.security.mscapi.RSASignature$Raw",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   164
                           null, attrs));
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   165
                putService(new ProviderService(p, "Signature",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   166
                           "SHA1withRSA", "sun.security.mscapi.RSASignature$SHA1",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   167
                           null, attrs));
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   168
                putService(new ProviderService(p, "Signature",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   169
                           "SHA256withRSA", "sun.security.mscapi.RSASignature$SHA256",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   170
                           new String[] { "1.2.840.113549.1.1.11", "OID.1.2.840.113549.1.1.11" },
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   171
                           attrs));
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   172
                putService(new ProviderService(p, "Signature",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   173
                           "SHA384withRSA", "sun.security.mscapi.RSASignature$SHA384",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   174
                           new String[] { "1.2.840.113549.1.1.12", "OID.1.2.840.113549.1.1.12" },
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   175
                           attrs));
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   176
                putService(new ProviderService(p, "Signature",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   177
                           "SHA512withRSA", "sun.security.mscapi.RSASignature$SHA512",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   178
                           new String[] { "1.2.840.113549.1.1.13", "OID.1.2.840.113549.1.1.13" },
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   179
                           attrs));
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   180
                putService(new ProviderService(p, "Signature",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   181
                           "MD5withRSA", "sun.security.mscapi.RSASignature$MD5",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   182
                           null, attrs));
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   183
                putService(new ProviderService(p, "Signature",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   184
                           "MD2withRSA", "sun.security.mscapi.RSASignature$MD2",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   185
                           null, attrs));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   186
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   187
                /*
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   188
                 * Key Pair Generator engines
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   189
                 */
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   190
                attrs.clear();
36249
8b92e4bedbd4 8138653: Default key sizes for the AlgorithmParameterGenerator and KeyPairGenerator implementations should be upgraded
mullan
parents: 33991
diff changeset
   191
                attrs.put("KeySize", "16384");
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   192
                putService(new ProviderService(p, "KeyPairGenerator",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   193
                           "RSA", "sun.security.mscapi.RSAKeyPairGenerator",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   194
                           null, attrs));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   196
                /*
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   197
                 * Cipher engines
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   198
                 */
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   199
                attrs.clear();
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   200
                attrs.put("SupportedModes", "ECB");
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   201
                attrs.put("SupportedPaddings", "PKCS1PADDING");
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   202
                attrs.put("SupportedKeyClasses", "sun.security.mscapi.Key");
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   203
                putService(new ProviderService(p, "Cipher",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   204
                           "RSA", "sun.security.mscapi.RSACipher",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   205
                           null, attrs));
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   206
                putService(new ProviderService(p, "Cipher",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   207
                           "RSA/ECB/PKCS1Padding", "sun.security.mscapi.RSACipher",
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   208
                           null, attrs));
23582
d5fa3327ab3a 8038177: Eliminate unnecessary dependency to sun.security.action
mchung
parents: 22121
diff changeset
   209
                return null;
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   210
            }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   211
        });
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   212
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   213
}