src/jdk.crypto.mscapi/windows/classes/sun/security/mscapi/SunMSCAPI.java
author weijun
Thu, 13 Dec 2018 17:28:19 +0800
changeset 53006 4debb3321e65
parent 50715 46492a773912
child 53007 e2798bf6318a
permissions -rw-r--r--
8213009: Refactoring existing SunMSCAPI classes Reviewed-by: valeriep
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
50715
46492a773912 8205445: Add RSASSA-PSS Signature support to SunMSCAPI
weijun
parents: 47216
diff changeset
     2
 * Copyright (c) 2005, 2018, 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
40416
5d91b2fd668c 8130181: Deprecate java.security.Provider(String, double, String), add Provider(Strin
valeriep
parents: 36249
diff changeset
    37
import static sun.security.util.SecurityConstants.PROVIDER_VER;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
/**
90ce3da70b43 Initial load
duke
parents:
diff changeset
    40
 * A Cryptographic Service Provider for the Microsoft Crypto API.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    42
 * @since 1.6
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
90ce3da70b43 Initial load
duke
parents:
diff changeset
    45
public final class SunMSCAPI extends Provider {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    46
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
    private static final long serialVersionUID = 8622598936488630849L; //TODO
90ce3da70b43 Initial load
duke
parents:
diff changeset
    48
90ce3da70b43 Initial load
duke
parents:
diff changeset
    49
    private static final String INFO = "Sun's Microsoft Crypto API provider";
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
90ce3da70b43 Initial load
duke
parents:
diff changeset
    51
    static {
51
6fe31bc95bbc 6600143: Remove another 450 unnecessary casts
martin
parents: 2
diff changeset
    52
        AccessController.doPrivileged(new PrivilegedAction<Void>() {
6fe31bc95bbc 6600143: Remove another 450 unnecessary casts
martin
parents: 2
diff changeset
    53
            public Void run() {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    54
                System.loadLibrary("sunmscapi");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    55
                return null;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    57
        });
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    60
    private static final class ProviderService extends Provider.Service {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    61
        ProviderService(Provider p, String type, String algo, String cn) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    62
            super(p, type, algo, cn, null, null);
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    63
        }
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
        ProviderService(Provider p, String type, String algo, String cn,
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    66
            String[] aliases, HashMap<String, String> attrs) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    67
            super(p, type, algo, cn,
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    68
                  (aliases == null? null : Arrays.asList(aliases)), attrs);
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    69
        }
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
        @Override
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    72
        public Object newInstance(Object ctrParamObj)
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    73
            throws NoSuchAlgorithmException {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    74
            String type = getType();
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    75
            if (ctrParamObj != null) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    76
                throw new InvalidParameterException
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    77
                    ("constructorParameter not used with " + type +
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    78
                     " engines");
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    79
            }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    80
            String algo = getAlgorithm();
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    81
            try {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    82
                if (type.equals("SecureRandom")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    83
                    if (algo.equals("Windows-PRNG")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    84
                        return new PRNG();
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    85
                    }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    86
                } else if (type.equals("KeyStore")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    87
                    if (algo.equals("Windows-MY")) {
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
    88
                        return new CKeyStore.MY();
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    89
                    } else if (algo.equals("Windows-ROOT")) {
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
    90
                        return new CKeyStore.ROOT();
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    91
                    }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    92
                } else if (type.equals("Signature")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    93
                    if (algo.equals("NONEwithRSA")) {
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
    94
                        return new CSignature.NONEwithRSA();
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    95
                    } else if (algo.equals("SHA1withRSA")) {
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
    96
                        return new CSignature.SHA1withRSA();
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    97
                    } else if (algo.equals("SHA256withRSA")) {
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
    98
                        return new CSignature.SHA256withRSA();
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
    99
                    } else if (algo.equals("SHA384withRSA")) {
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   100
                        return new CSignature.SHA384withRSA();
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   101
                    } else if (algo.equals("SHA512withRSA")) {
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   102
                        return new CSignature.SHA512withRSA();
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   103
                    } else if (algo.equals("MD5withRSA")) {
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   104
                        return new CSignature.MD5withRSA();
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   105
                    } else if (algo.equals("MD2withRSA")) {
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   106
                        return new CSignature.MD2withRSA();
50715
46492a773912 8205445: Add RSASSA-PSS Signature support to SunMSCAPI
weijun
parents: 47216
diff changeset
   107
                    } else if (algo.equals("RSASSA-PSS")) {
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   108
                        return new CSignature.PSS();
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   109
                    }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   110
                } else if (type.equals("KeyPairGenerator")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   111
                    if (algo.equals("RSA")) {
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   112
                        return new CKeyPairGenerator.RSA();
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   113
                    }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   114
                } else if (type.equals("Cipher")) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   115
                    if (algo.equals("RSA") ||
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   116
                        algo.equals("RSA/ECB/PKCS1Padding")) {
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   117
                        return new CRSACipher();
31270
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
                }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   120
            } catch (Exception ex) {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   121
                throw new NoSuchAlgorithmException
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   122
                    ("Error constructing " + type + " for " +
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   123
                    algo + " using SunMSCAPI", ex);
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   124
            }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   125
            throw new ProviderException("No impl for " + algo +
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   126
                " " + type);
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
    }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   129
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   130
    public SunMSCAPI() {
40416
5d91b2fd668c 8130181: Deprecate java.security.Provider(String, double, String), add Provider(Strin
valeriep
parents: 36249
diff changeset
   131
        super("SunMSCAPI", PROVIDER_VER, INFO);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   133
        final Provider p = this;
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   134
        AccessController.doPrivileged(new PrivilegedAction<Void>() {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   135
            public Void run() {
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   136
                /*
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   137
                 * Secure random
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   138
                 */
42161
5b0b84715c06 7004967: SecureRandom should be more explicit about threading
weijun
parents: 40416
diff changeset
   139
                HashMap<String, String> srattrs = new HashMap<>(1);
5b0b84715c06 7004967: SecureRandom should be more explicit about threading
weijun
parents: 40416
diff changeset
   140
                srattrs.put("ThreadSafe", "true");
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   141
                putService(new ProviderService(p, "SecureRandom",
42161
5b0b84715c06 7004967: SecureRandom should be more explicit about threading
weijun
parents: 40416
diff changeset
   142
                           "Windows-PRNG", "sun.security.mscapi.PRNG",
5b0b84715c06 7004967: SecureRandom should be more explicit about threading
weijun
parents: 40416
diff changeset
   143
                           null, srattrs));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   145
                /*
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   146
                 * Key store
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   147
                 */
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   148
                putService(new ProviderService(p, "KeyStore",
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   149
                           "Windows-MY", "sun.security.mscapi.CKeyStore$MY"));
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   150
                putService(new ProviderService(p, "KeyStore",
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   151
                           "Windows-ROOT", "sun.security.mscapi.CKeyStore$ROOT"));
12685
8a448b5b9006 4963723: Implement SHA-224
valeriep
parents: 10336
diff changeset
   152
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   153
                /*
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   154
                 * Signature engines
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   155
                 */
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   156
                HashMap<String, String> attrs = new HashMap<>(1);
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   157
                attrs.put("SupportedKeyClasses", "sun.security.mscapi.CKey");
12685
8a448b5b9006 4963723: Implement SHA-224
valeriep
parents: 10336
diff changeset
   158
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   159
                // NONEwithRSA must be supplied with a pre-computed message digest.
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   160
                // Only the following digest algorithms are supported: MD5, SHA-1,
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   161
                // 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
   162
                // 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
   163
                putService(new ProviderService(p, "Signature",
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   164
                           "NONEwithRSA", "sun.security.mscapi.CSignature$NONEwithRSA",
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   165
                           null, attrs));
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   166
                putService(new ProviderService(p, "Signature",
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   167
                           "SHA1withRSA", "sun.security.mscapi.CSignature$SHA1withRSA",
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   168
                           null, attrs));
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   169
                putService(new ProviderService(p, "Signature",
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   170
                           "SHA256withRSA", "sun.security.mscapi.CSignature$SHA256withRSA",
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   171
                           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
   172
                           attrs));
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   173
                putService(new ProviderService(p, "Signature",
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   174
                           "SHA384withRSA", "sun.security.mscapi.CSignature$SHA384withRSA",
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   175
                           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
   176
                           attrs));
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   177
                putService(new ProviderService(p, "Signature",
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   178
                           "SHA512withRSA", "sun.security.mscapi.CSignature$SHA512withRSA",
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   179
                           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
   180
                           attrs));
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   181
                putService(new ProviderService(p, "Signature",
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   182
                        "RSASSA-PSS", "sun.security.mscapi.CSignature$PSS",
50715
46492a773912 8205445: Add RSASSA-PSS Signature support to SunMSCAPI
weijun
parents: 47216
diff changeset
   183
                        new String[] { "1.2.840.113549.1.1.10", "OID.1.2.840.113549.1.1.10" },
46492a773912 8205445: Add RSASSA-PSS Signature support to SunMSCAPI
weijun
parents: 47216
diff changeset
   184
                        attrs));
46492a773912 8205445: Add RSASSA-PSS Signature support to SunMSCAPI
weijun
parents: 47216
diff changeset
   185
                putService(new ProviderService(p, "Signature",
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   186
                           "MD5withRSA", "sun.security.mscapi.CSignature$MD5withRSA",
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   187
                           null, attrs));
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   188
                putService(new ProviderService(p, "Signature",
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   189
                           "MD2withRSA", "sun.security.mscapi.CSignature$MD2withRSA",
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   190
                           null, attrs));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   192
                /*
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   193
                 * Key Pair Generator engines
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   194
                 */
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   195
                attrs.clear();
36249
8b92e4bedbd4 8138653: Default key sizes for the AlgorithmParameterGenerator and KeyPairGenerator implementations should be upgraded
mullan
parents: 33991
diff changeset
   196
                attrs.put("KeySize", "16384");
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   197
                putService(new ProviderService(p, "KeyPairGenerator",
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   198
                           "RSA", "sun.security.mscapi.CKeyPairGenerator$RSA",
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   199
                           null, attrs));
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   201
                /*
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   202
                 * Cipher engines
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   203
                 */
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   204
                attrs.clear();
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   205
                attrs.put("SupportedModes", "ECB");
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   206
                attrs.put("SupportedPaddings", "PKCS1PADDING");
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   207
                attrs.put("SupportedKeyClasses", "sun.security.mscapi.CKey");
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   208
                putService(new ProviderService(p, "Cipher",
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   209
                           "RSA", "sun.security.mscapi.CRSACipher",
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   210
                           null, attrs));
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   211
                putService(new ProviderService(p, "Cipher",
53006
4debb3321e65 8213009: Refactoring existing SunMSCAPI classes
weijun
parents: 50715
diff changeset
   212
                           "RSA/ECB/PKCS1Padding", "sun.security.mscapi.CRSACipher",
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   213
                           null, attrs));
23582
d5fa3327ab3a 8038177: Eliminate unnecessary dependency to sun.security.action
mchung
parents: 22121
diff changeset
   214
                return null;
31270
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   215
            }
e6470b24700d 7191662: JCE providers should be located via ServiceLoader
valeriep
parents: 25859
diff changeset
   216
        });
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   217
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   218
}