author | weijun |
Thu, 13 Dec 2018 17:28:30 +0800 | |
changeset 53007 | e2798bf6318a |
parent 53006 | 4debb3321e65 |
permissions | -rw-r--r-- |
2 | 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 | 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 |
|
5506 | 7 |
* published by the Free Software Foundation. Oracle designates this |
2 | 8 |
* particular file as subject to the "Classpath" exception as provided |
5506 | 9 |
* by Oracle in the LICENSE file that accompanied this code. |
2 | 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 |
* |
|
5506 | 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 |
|
23 |
* questions. |
|
2 | 24 |
*/ |
25 |
||
26 |
package sun.security.mscapi; |
|
27 |
||
28 |
import java.security.AccessController; |
|
29 |
import java.security.PrivilegedAction; |
|
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 | 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 | 38 |
|
39 |
/** |
|
40 |
* A Cryptographic Service Provider for the Microsoft Crypto API. |
|
41 |
* |
|
42 |
* @since 1.6 |
|
43 |
*/ |
|
44 |
||
45 |
public final class SunMSCAPI extends Provider { |
|
46 |
||
47 |
private static final long serialVersionUID = 8622598936488630849L; //TODO |
|
48 |
||
49 |
private static final String INFO = "Sun's Microsoft Crypto API provider"; |
|
50 |
||
51 |
static { |
|
51 | 52 |
AccessController.doPrivileged(new PrivilegedAction<Void>() { |
53 |
public Void run() { |
|
2 | 54 |
System.loadLibrary("sunmscapi"); |
55 |
return null; |
|
56 |
} |
|
57 |
}); |
|
58 |
} |
|
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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 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 | 108 |
return new CSignature.PSS(); |
53007 | 109 |
} else if (algo.equals("SHA1withECDSA")) { |
110 |
return new CSignature.SHA1withECDSA(); |
|
111 |
} else if (algo.equals("SHA224withECDSA")) { |
|
112 |
return new CSignature.SHA224withECDSA(); |
|
113 |
} else if (algo.equals("SHA256withECDSA")) { |
|
114 |
return new CSignature.SHA256withECDSA(); |
|
115 |
} else if (algo.equals("SHA384withECDSA")) { |
|
116 |
return new CSignature.SHA384withECDSA(); |
|
117 |
} else if (algo.equals("SHA512withECDSA")) { |
|
118 |
return new CSignature.SHA512withECDSA(); |
|
31270
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 |
} else if (type.equals("KeyPairGenerator")) { |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
121 |
if (algo.equals("RSA")) { |
53006 | 122 |
return new CKeyPairGenerator.RSA(); |
31270
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 |
} else if (type.equals("Cipher")) { |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
125 |
if (algo.equals("RSA") || |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
126 |
algo.equals("RSA/ECB/PKCS1Padding")) { |
53006 | 127 |
return new CRSACipher(); |
31270
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 |
} |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
130 |
} catch (Exception ex) { |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
131 |
throw new NoSuchAlgorithmException |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
132 |
("Error constructing " + type + " for " + |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
133 |
algo + " using SunMSCAPI", ex); |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
134 |
} |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
135 |
throw new ProviderException("No impl for " + algo + |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
136 |
" " + type); |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
137 |
} |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
138 |
} |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
139 |
|
2 | 140 |
public SunMSCAPI() { |
40416
5d91b2fd668c
8130181: Deprecate java.security.Provider(String, double, String), add Provider(Strin
valeriep
parents:
36249
diff
changeset
|
141 |
super("SunMSCAPI", PROVIDER_VER, INFO); |
2 | 142 |
|
31270
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
143 |
final Provider p = this; |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
144 |
AccessController.doPrivileged(new PrivilegedAction<Void>() { |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
145 |
public Void run() { |
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 |
* Secure random |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
148 |
*/ |
42161
5b0b84715c06
7004967: SecureRandom should be more explicit about threading
weijun
parents:
40416
diff
changeset
|
149 |
HashMap<String, String> srattrs = new HashMap<>(1); |
5b0b84715c06
7004967: SecureRandom should be more explicit about threading
weijun
parents:
40416
diff
changeset
|
150 |
srattrs.put("ThreadSafe", "true"); |
31270
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
151 |
putService(new ProviderService(p, "SecureRandom", |
42161
5b0b84715c06
7004967: SecureRandom should be more explicit about threading
weijun
parents:
40416
diff
changeset
|
152 |
"Windows-PRNG", "sun.security.mscapi.PRNG", |
5b0b84715c06
7004967: SecureRandom should be more explicit about threading
weijun
parents:
40416
diff
changeset
|
153 |
null, srattrs)); |
2 | 154 |
|
31270
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 |
* Key store |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
157 |
*/ |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
158 |
putService(new ProviderService(p, "KeyStore", |
53006 | 159 |
"Windows-MY", "sun.security.mscapi.CKeyStore$MY")); |
31270
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
160 |
putService(new ProviderService(p, "KeyStore", |
53006 | 161 |
"Windows-ROOT", "sun.security.mscapi.CKeyStore$ROOT")); |
12685 | 162 |
|
31270
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
163 |
/* |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
164 |
* Signature engines |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
165 |
*/ |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
166 |
HashMap<String, String> attrs = new HashMap<>(1); |
53006 | 167 |
attrs.put("SupportedKeyClasses", "sun.security.mscapi.CKey"); |
12685 | 168 |
|
31270
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
169 |
// NONEwithRSA must be supplied with a pre-computed message digest. |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
170 |
// Only the following digest algorithms are supported: MD5, SHA-1, |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
171 |
// 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
|
172 |
// 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
|
173 |
putService(new ProviderService(p, "Signature", |
53006 | 174 |
"NONEwithRSA", "sun.security.mscapi.CSignature$NONEwithRSA", |
31270
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
175 |
null, attrs)); |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
176 |
putService(new ProviderService(p, "Signature", |
53006 | 177 |
"SHA1withRSA", "sun.security.mscapi.CSignature$SHA1withRSA", |
31270
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
178 |
null, attrs)); |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
179 |
putService(new ProviderService(p, "Signature", |
53006 | 180 |
"SHA256withRSA", "sun.security.mscapi.CSignature$SHA256withRSA", |
31270
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
181 |
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
|
182 |
attrs)); |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
183 |
putService(new ProviderService(p, "Signature", |
53006 | 184 |
"SHA384withRSA", "sun.security.mscapi.CSignature$SHA384withRSA", |
31270
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
185 |
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
|
186 |
attrs)); |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
187 |
putService(new ProviderService(p, "Signature", |
53006 | 188 |
"SHA512withRSA", "sun.security.mscapi.CSignature$SHA512withRSA", |
31270
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
189 |
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
|
190 |
attrs)); |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
191 |
putService(new ProviderService(p, "Signature", |
53006 | 192 |
"RSASSA-PSS", "sun.security.mscapi.CSignature$PSS", |
50715
46492a773912
8205445: Add RSASSA-PSS Signature support to SunMSCAPI
weijun
parents:
47216
diff
changeset
|
193 |
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
|
194 |
attrs)); |
46492a773912
8205445: Add RSASSA-PSS Signature support to SunMSCAPI
weijun
parents:
47216
diff
changeset
|
195 |
putService(new ProviderService(p, "Signature", |
53006 | 196 |
"MD5withRSA", "sun.security.mscapi.CSignature$MD5withRSA", |
31270
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
197 |
null, attrs)); |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
198 |
putService(new ProviderService(p, "Signature", |
53006 | 199 |
"MD2withRSA", "sun.security.mscapi.CSignature$MD2withRSA", |
31270
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
200 |
null, attrs)); |
53007 | 201 |
putService(new ProviderService(p, "Signature", |
202 |
"SHA1withECDSA", "sun.security.mscapi.CSignature$SHA1withECDSA", |
|
203 |
new String[] { "1.2.840.10045.4.1", "OID.1.2.840.10045.4.1" }, |
|
204 |
attrs)); |
|
205 |
putService(new ProviderService(p, "Signature", |
|
206 |
"SHA224withECDSA", "sun.security.mscapi.CSignature$SHA224withECDSA", |
|
207 |
new String[] { "1.2.840.10045.4.3.1", "OID.1.2.840.10045.4.3.1"}, |
|
208 |
attrs)); |
|
209 |
putService(new ProviderService(p, "Signature", |
|
210 |
"SHA256withECDSA", "sun.security.mscapi.CSignature$SHA256withECDSA", |
|
211 |
new String[] { "1.2.840.10045.4.3.2", "OID.1.2.840.10045.4.3.2"}, |
|
212 |
attrs)); |
|
213 |
putService(new ProviderService(p, "Signature", |
|
214 |
"SHA384withECDSA", "sun.security.mscapi.CSignature$SHA384withECDSA", |
|
215 |
new String[] { "1.2.840.10045.4.3.3", "OID.1.2.840.10045.4.3.3"}, |
|
216 |
attrs)); |
|
217 |
putService(new ProviderService(p, "Signature", |
|
218 |
"SHA512withECDSA", "sun.security.mscapi.CSignature$SHA512withECDSA", |
|
219 |
new String[] { "1.2.840.10045.4.3.4", "OID.1.2.840.10045.4.3.4"}, |
|
220 |
attrs)); |
|
31270
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
221 |
/* |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
222 |
* Key Pair Generator engines |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
223 |
*/ |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
224 |
attrs.clear(); |
36249
8b92e4bedbd4
8138653: Default key sizes for the AlgorithmParameterGenerator and KeyPairGenerator implementations should be upgraded
mullan
parents:
33991
diff
changeset
|
225 |
attrs.put("KeySize", "16384"); |
31270
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
226 |
putService(new ProviderService(p, "KeyPairGenerator", |
53006 | 227 |
"RSA", "sun.security.mscapi.CKeyPairGenerator$RSA", |
31270
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
228 |
null, attrs)); |
2 | 229 |
|
31270
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
230 |
/* |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
231 |
* Cipher engines |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
232 |
*/ |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
233 |
attrs.clear(); |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
234 |
attrs.put("SupportedModes", "ECB"); |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
235 |
attrs.put("SupportedPaddings", "PKCS1PADDING"); |
53006 | 236 |
attrs.put("SupportedKeyClasses", "sun.security.mscapi.CKey"); |
31270
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
237 |
putService(new ProviderService(p, "Cipher", |
53006 | 238 |
"RSA", "sun.security.mscapi.CRSACipher", |
31270
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
239 |
null, attrs)); |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
240 |
putService(new ProviderService(p, "Cipher", |
53006 | 241 |
"RSA/ECB/PKCS1Padding", "sun.security.mscapi.CRSACipher", |
31270
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
242 |
null, attrs)); |
23582
d5fa3327ab3a
8038177: Eliminate unnecessary dependency to sun.security.action
mchung
parents:
22121
diff
changeset
|
243 |
return null; |
31270
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
244 |
} |
e6470b24700d
7191662: JCE providers should be located via ServiceLoader
valeriep
parents:
25859
diff
changeset
|
245 |
}); |
2 | 246 |
} |
247 |
} |