• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2020 The Android Open Source Project
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *      http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 package com.android.apksig.internal.oid;
18 
19 import com.android.apksig.internal.util.InclusiveIntRange;
20 
21 import java.util.Arrays;
22 import java.util.Collections;
23 import java.util.HashMap;
24 import java.util.List;
25 import java.util.Map;
26 
27 public class OidConstants {
28     public static final String OID_DIGEST_MD5 = "1.2.840.113549.2.5";
29     public static final String OID_DIGEST_SHA1 = "1.3.14.3.2.26";
30     public static final String OID_DIGEST_SHA224 = "2.16.840.1.101.3.4.2.4";
31     public static final String OID_DIGEST_SHA256 = "2.16.840.1.101.3.4.2.1";
32     public static final String OID_DIGEST_SHA384 = "2.16.840.1.101.3.4.2.2";
33     public static final String OID_DIGEST_SHA512 = "2.16.840.1.101.3.4.2.3";
34 
35     public static final String OID_SIG_RSA = "1.2.840.113549.1.1.1";
36     public static final String OID_SIG_MD5_WITH_RSA = "1.2.840.113549.1.1.4";
37     public static final String OID_SIG_SHA1_WITH_RSA = "1.2.840.113549.1.1.5";
38     public static final String OID_SIG_SHA224_WITH_RSA = "1.2.840.113549.1.1.14";
39     public static final String OID_SIG_SHA256_WITH_RSA = "1.2.840.113549.1.1.11";
40     public static final String OID_SIG_SHA384_WITH_RSA = "1.2.840.113549.1.1.12";
41     public static final String OID_SIG_SHA512_WITH_RSA = "1.2.840.113549.1.1.13";
42 
43     public static final String OID_SIG_DSA = "1.2.840.10040.4.1";
44     public static final String OID_SIG_SHA1_WITH_DSA = "1.2.840.10040.4.3";
45     public static final String OID_SIG_SHA224_WITH_DSA = "2.16.840.1.101.3.4.3.1";
46     public static final String OID_SIG_SHA256_WITH_DSA = "2.16.840.1.101.3.4.3.2";
47     public static final String OID_SIG_SHA384_WITH_DSA = "2.16.840.1.101.3.4.3.3";
48     public static final String OID_SIG_SHA512_WITH_DSA = "2.16.840.1.101.3.4.3.4";
49 
50     public static final String OID_SIG_EC_PUBLIC_KEY = "1.2.840.10045.2.1";
51     public static final String OID_SIG_SHA1_WITH_ECDSA = "1.2.840.10045.4.1";
52     public static final String OID_SIG_SHA224_WITH_ECDSA = "1.2.840.10045.4.3.1";
53     public static final String OID_SIG_SHA256_WITH_ECDSA = "1.2.840.10045.4.3.2";
54     public static final String OID_SIG_SHA384_WITH_ECDSA = "1.2.840.10045.4.3.3";
55     public static final String OID_SIG_SHA512_WITH_ECDSA = "1.2.840.10045.4.3.4";
56 
57     public static final Map<String, List<InclusiveIntRange>> SUPPORTED_SIG_ALG_OIDS =
58             new HashMap<>();
59     static {
addSupportedSigAlg( OID_DIGEST_MD5, OID_SIG_RSA, InclusiveIntRange.from(0))60         addSupportedSigAlg(
61                 OID_DIGEST_MD5, OID_SIG_RSA,
62                 InclusiveIntRange.from(0));
addSupportedSigAlg( OID_DIGEST_MD5, OID_SIG_MD5_WITH_RSA, InclusiveIntRange.fromTo(0, 8), InclusiveIntRange.from(21))63         addSupportedSigAlg(
64                 OID_DIGEST_MD5, OID_SIG_MD5_WITH_RSA,
65                 InclusiveIntRange.fromTo(0, 8), InclusiveIntRange.from(21));
addSupportedSigAlg( OID_DIGEST_MD5, OID_SIG_SHA1_WITH_RSA, InclusiveIntRange.fromTo(21, 23))66         addSupportedSigAlg(
67                 OID_DIGEST_MD5, OID_SIG_SHA1_WITH_RSA,
68                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_MD5, OID_SIG_SHA224_WITH_RSA, InclusiveIntRange.fromTo(21, 23))69         addSupportedSigAlg(
70                 OID_DIGEST_MD5, OID_SIG_SHA224_WITH_RSA,
71                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_MD5, OID_SIG_SHA256_WITH_RSA, InclusiveIntRange.fromTo(21, 23))72         addSupportedSigAlg(
73                 OID_DIGEST_MD5, OID_SIG_SHA256_WITH_RSA,
74                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_MD5, OID_SIG_SHA384_WITH_RSA, InclusiveIntRange.fromTo(21, 23))75         addSupportedSigAlg(
76                 OID_DIGEST_MD5, OID_SIG_SHA384_WITH_RSA,
77                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_MD5, OID_SIG_SHA512_WITH_RSA, InclusiveIntRange.fromTo(21, 23))78         addSupportedSigAlg(
79                 OID_DIGEST_MD5, OID_SIG_SHA512_WITH_RSA,
80                 InclusiveIntRange.fromTo(21, 23));
81 
addSupportedSigAlg( OID_DIGEST_SHA1, OID_SIG_RSA, InclusiveIntRange.from(0))82         addSupportedSigAlg(
83                 OID_DIGEST_SHA1, OID_SIG_RSA,
84                 InclusiveIntRange.from(0));
addSupportedSigAlg( OID_DIGEST_SHA1, OID_SIG_MD5_WITH_RSA, InclusiveIntRange.fromTo(21, 23))85         addSupportedSigAlg(
86                 OID_DIGEST_SHA1, OID_SIG_MD5_WITH_RSA,
87                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA1, OID_SIG_SHA1_WITH_RSA, InclusiveIntRange.from(0))88         addSupportedSigAlg(
89                 OID_DIGEST_SHA1, OID_SIG_SHA1_WITH_RSA,
90                 InclusiveIntRange.from(0));
addSupportedSigAlg( OID_DIGEST_SHA1, OID_SIG_SHA224_WITH_RSA, InclusiveIntRange.fromTo(21, 23))91         addSupportedSigAlg(
92                 OID_DIGEST_SHA1, OID_SIG_SHA224_WITH_RSA,
93                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA1, OID_SIG_SHA256_WITH_RSA, InclusiveIntRange.fromTo(21, 23))94         addSupportedSigAlg(
95                 OID_DIGEST_SHA1, OID_SIG_SHA256_WITH_RSA,
96                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA1, OID_SIG_SHA384_WITH_RSA, InclusiveIntRange.fromTo(21, 23))97         addSupportedSigAlg(
98                 OID_DIGEST_SHA1, OID_SIG_SHA384_WITH_RSA,
99                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA1, OID_SIG_SHA512_WITH_RSA, InclusiveIntRange.fromTo(21, 23))100         addSupportedSigAlg(
101                 OID_DIGEST_SHA1, OID_SIG_SHA512_WITH_RSA,
102                 InclusiveIntRange.fromTo(21, 23));
103 
addSupportedSigAlg( OID_DIGEST_SHA224, OID_SIG_RSA, InclusiveIntRange.fromTo(0, 8), InclusiveIntRange.from(21))104         addSupportedSigAlg(
105                 OID_DIGEST_SHA224, OID_SIG_RSA,
106                 InclusiveIntRange.fromTo(0, 8), InclusiveIntRange.from(21));
addSupportedSigAlg( OID_DIGEST_SHA224, OID_SIG_MD5_WITH_RSA, InclusiveIntRange.fromTo(21, 23))107         addSupportedSigAlg(
108                 OID_DIGEST_SHA224, OID_SIG_MD5_WITH_RSA,
109                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA224, OID_SIG_SHA1_WITH_RSA, InclusiveIntRange.fromTo(21, 23))110         addSupportedSigAlg(
111                 OID_DIGEST_SHA224, OID_SIG_SHA1_WITH_RSA,
112                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA224, OID_SIG_SHA224_WITH_RSA, InclusiveIntRange.fromTo(0, 8), InclusiveIntRange.from(21))113         addSupportedSigAlg(
114                 OID_DIGEST_SHA224, OID_SIG_SHA224_WITH_RSA,
115                 InclusiveIntRange.fromTo(0, 8), InclusiveIntRange.from(21));
addSupportedSigAlg( OID_DIGEST_SHA224, OID_SIG_SHA256_WITH_RSA, InclusiveIntRange.fromTo(21, 21))116         addSupportedSigAlg(
117                 OID_DIGEST_SHA224, OID_SIG_SHA256_WITH_RSA,
118                 InclusiveIntRange.fromTo(21, 21));
addSupportedSigAlg( OID_DIGEST_SHA224, OID_SIG_SHA384_WITH_RSA, InclusiveIntRange.fromTo(21, 23))119         addSupportedSigAlg(
120                 OID_DIGEST_SHA224, OID_SIG_SHA384_WITH_RSA,
121                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA224, OID_SIG_SHA512_WITH_RSA, InclusiveIntRange.fromTo(21, 23))122         addSupportedSigAlg(
123                 OID_DIGEST_SHA224, OID_SIG_SHA512_WITH_RSA,
124                 InclusiveIntRange.fromTo(21, 23));
125 
addSupportedSigAlg( OID_DIGEST_SHA256, OID_SIG_RSA, InclusiveIntRange.fromTo(0, 8), InclusiveIntRange.from(18))126         addSupportedSigAlg(
127                 OID_DIGEST_SHA256, OID_SIG_RSA,
128                 InclusiveIntRange.fromTo(0, 8), InclusiveIntRange.from(18));
addSupportedSigAlg( OID_DIGEST_SHA256, OID_SIG_MD5_WITH_RSA, InclusiveIntRange.fromTo(21, 23))129         addSupportedSigAlg(
130                 OID_DIGEST_SHA256, OID_SIG_MD5_WITH_RSA,
131                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA256, OID_SIG_SHA1_WITH_RSA, InclusiveIntRange.fromTo(21, 21))132         addSupportedSigAlg(
133                 OID_DIGEST_SHA256, OID_SIG_SHA1_WITH_RSA,
134                 InclusiveIntRange.fromTo(21, 21));
addSupportedSigAlg( OID_DIGEST_SHA256, OID_SIG_SHA224_WITH_RSA, InclusiveIntRange.fromTo(21, 23))135         addSupportedSigAlg(
136                 OID_DIGEST_SHA256, OID_SIG_SHA224_WITH_RSA,
137                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA256, OID_SIG_SHA256_WITH_RSA, InclusiveIntRange.fromTo(0, 8), InclusiveIntRange.from(18))138         addSupportedSigAlg(
139                 OID_DIGEST_SHA256, OID_SIG_SHA256_WITH_RSA,
140                 InclusiveIntRange.fromTo(0, 8), InclusiveIntRange.from(18));
addSupportedSigAlg( OID_DIGEST_SHA256, OID_SIG_SHA384_WITH_RSA, InclusiveIntRange.fromTo(21, 23))141         addSupportedSigAlg(
142                 OID_DIGEST_SHA256, OID_SIG_SHA384_WITH_RSA,
143                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA256, OID_SIG_SHA512_WITH_RSA, InclusiveIntRange.fromTo(21, 23))144         addSupportedSigAlg(
145                 OID_DIGEST_SHA256, OID_SIG_SHA512_WITH_RSA,
146                 InclusiveIntRange.fromTo(21, 23));
147 
addSupportedSigAlg( OID_DIGEST_SHA384, OID_SIG_RSA, InclusiveIntRange.from(18))148         addSupportedSigAlg(
149                 OID_DIGEST_SHA384, OID_SIG_RSA,
150                 InclusiveIntRange.from(18));
addSupportedSigAlg( OID_DIGEST_SHA384, OID_SIG_MD5_WITH_RSA, InclusiveIntRange.fromTo(21, 23))151         addSupportedSigAlg(
152                 OID_DIGEST_SHA384, OID_SIG_MD5_WITH_RSA,
153                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA384, OID_SIG_SHA1_WITH_RSA, InclusiveIntRange.fromTo(21, 23))154         addSupportedSigAlg(
155                 OID_DIGEST_SHA384, OID_SIG_SHA1_WITH_RSA,
156                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA384, OID_SIG_SHA224_WITH_RSA, InclusiveIntRange.fromTo(21, 23))157         addSupportedSigAlg(
158                 OID_DIGEST_SHA384, OID_SIG_SHA224_WITH_RSA,
159                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA384, OID_SIG_SHA256_WITH_RSA, InclusiveIntRange.fromTo(21, 23))160         addSupportedSigAlg(
161                 OID_DIGEST_SHA384, OID_SIG_SHA256_WITH_RSA,
162                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA384, OID_SIG_SHA384_WITH_RSA, InclusiveIntRange.from(21))163         addSupportedSigAlg(
164                 OID_DIGEST_SHA384, OID_SIG_SHA384_WITH_RSA,
165                 InclusiveIntRange.from(21));
addSupportedSigAlg( OID_DIGEST_SHA384, OID_SIG_SHA512_WITH_RSA, InclusiveIntRange.fromTo(21, 23))166         addSupportedSigAlg(
167                 OID_DIGEST_SHA384, OID_SIG_SHA512_WITH_RSA,
168                 InclusiveIntRange.fromTo(21, 23));
169 
addSupportedSigAlg( OID_DIGEST_SHA512, OID_SIG_RSA, InclusiveIntRange.from(18))170         addSupportedSigAlg(
171                 OID_DIGEST_SHA512, OID_SIG_RSA,
172                 InclusiveIntRange.from(18));
addSupportedSigAlg( OID_DIGEST_SHA512, OID_SIG_MD5_WITH_RSA, InclusiveIntRange.fromTo(21, 23))173         addSupportedSigAlg(
174                 OID_DIGEST_SHA512, OID_SIG_MD5_WITH_RSA,
175                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA512, OID_SIG_SHA1_WITH_RSA, InclusiveIntRange.fromTo(21, 23))176         addSupportedSigAlg(
177                 OID_DIGEST_SHA512, OID_SIG_SHA1_WITH_RSA,
178                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA512, OID_SIG_SHA224_WITH_RSA, InclusiveIntRange.fromTo(21, 23))179         addSupportedSigAlg(
180                 OID_DIGEST_SHA512, OID_SIG_SHA224_WITH_RSA,
181                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA512, OID_SIG_SHA256_WITH_RSA, InclusiveIntRange.fromTo(21, 23))182         addSupportedSigAlg(
183                 OID_DIGEST_SHA512, OID_SIG_SHA256_WITH_RSA,
184                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA512, OID_SIG_SHA384_WITH_RSA, InclusiveIntRange.fromTo(21, 21))185         addSupportedSigAlg(
186                 OID_DIGEST_SHA512, OID_SIG_SHA384_WITH_RSA,
187                 InclusiveIntRange.fromTo(21, 21));
addSupportedSigAlg( OID_DIGEST_SHA512, OID_SIG_SHA512_WITH_RSA, InclusiveIntRange.from(21))188         addSupportedSigAlg(
189                 OID_DIGEST_SHA512, OID_SIG_SHA512_WITH_RSA,
190                 InclusiveIntRange.from(21));
191 
addSupportedSigAlg( OID_DIGEST_MD5, OID_SIG_SHA1_WITH_DSA, InclusiveIntRange.fromTo(21, 23))192         addSupportedSigAlg(
193                 OID_DIGEST_MD5, OID_SIG_SHA1_WITH_DSA,
194                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_MD5, OID_SIG_SHA224_WITH_DSA, InclusiveIntRange.fromTo(21, 23))195         addSupportedSigAlg(
196                 OID_DIGEST_MD5, OID_SIG_SHA224_WITH_DSA,
197                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_MD5, OID_SIG_SHA256_WITH_DSA, InclusiveIntRange.fromTo(21, 23))198         addSupportedSigAlg(
199                 OID_DIGEST_MD5, OID_SIG_SHA256_WITH_DSA,
200                 InclusiveIntRange.fromTo(21, 23));
201 
addSupportedSigAlg( OID_DIGEST_SHA1, OID_SIG_DSA, InclusiveIntRange.from(0))202         addSupportedSigAlg(
203                 OID_DIGEST_SHA1, OID_SIG_DSA,
204                 InclusiveIntRange.from(0));
addSupportedSigAlg( OID_DIGEST_SHA1, OID_SIG_SHA1_WITH_DSA, InclusiveIntRange.from(9))205         addSupportedSigAlg(
206                 OID_DIGEST_SHA1, OID_SIG_SHA1_WITH_DSA,
207                 InclusiveIntRange.from(9));
addSupportedSigAlg( OID_DIGEST_SHA1, OID_SIG_SHA224_WITH_DSA, InclusiveIntRange.fromTo(21, 23))208         addSupportedSigAlg(
209                 OID_DIGEST_SHA1, OID_SIG_SHA224_WITH_DSA,
210                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA1, OID_SIG_SHA256_WITH_DSA, InclusiveIntRange.fromTo(21, 23))211         addSupportedSigAlg(
212                 OID_DIGEST_SHA1, OID_SIG_SHA256_WITH_DSA,
213                 InclusiveIntRange.fromTo(21, 23));
214 
addSupportedSigAlg( OID_DIGEST_SHA224, OID_SIG_DSA, InclusiveIntRange.from(22))215         addSupportedSigAlg(
216                 OID_DIGEST_SHA224, OID_SIG_DSA,
217                 InclusiveIntRange.from(22));
addSupportedSigAlg( OID_DIGEST_SHA224, OID_SIG_SHA1_WITH_DSA, InclusiveIntRange.fromTo(21, 23))218         addSupportedSigAlg(
219                 OID_DIGEST_SHA224, OID_SIG_SHA1_WITH_DSA,
220                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA224, OID_SIG_SHA224_WITH_DSA, InclusiveIntRange.from(21))221         addSupportedSigAlg(
222                 OID_DIGEST_SHA224, OID_SIG_SHA224_WITH_DSA,
223                 InclusiveIntRange.from(21));
addSupportedSigAlg( OID_DIGEST_SHA224, OID_SIG_SHA256_WITH_DSA, InclusiveIntRange.fromTo(21, 23))224         addSupportedSigAlg(
225                 OID_DIGEST_SHA224, OID_SIG_SHA256_WITH_DSA,
226                 InclusiveIntRange.fromTo(21, 23));
227 
addSupportedSigAlg( OID_DIGEST_SHA256, OID_SIG_DSA, InclusiveIntRange.from(22))228         addSupportedSigAlg(
229                 OID_DIGEST_SHA256, OID_SIG_DSA,
230                 InclusiveIntRange.from(22));
addSupportedSigAlg( OID_DIGEST_SHA256, OID_SIG_SHA1_WITH_DSA, InclusiveIntRange.fromTo(21, 23))231         addSupportedSigAlg(
232                 OID_DIGEST_SHA256, OID_SIG_SHA1_WITH_DSA,
233                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA256, OID_SIG_SHA224_WITH_DSA, InclusiveIntRange.fromTo(21, 23))234         addSupportedSigAlg(
235                 OID_DIGEST_SHA256, OID_SIG_SHA224_WITH_DSA,
236                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA256, OID_SIG_SHA256_WITH_DSA, InclusiveIntRange.from(21))237         addSupportedSigAlg(
238                 OID_DIGEST_SHA256, OID_SIG_SHA256_WITH_DSA,
239                 InclusiveIntRange.from(21));
240 
addSupportedSigAlg( OID_DIGEST_SHA384, OID_SIG_SHA1_WITH_DSA, InclusiveIntRange.fromTo(21, 23))241         addSupportedSigAlg(
242                 OID_DIGEST_SHA384, OID_SIG_SHA1_WITH_DSA,
243                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA384, OID_SIG_SHA224_WITH_DSA, InclusiveIntRange.fromTo(21, 23))244         addSupportedSigAlg(
245                 OID_DIGEST_SHA384, OID_SIG_SHA224_WITH_DSA,
246                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA384, OID_SIG_SHA256_WITH_DSA, InclusiveIntRange.fromTo(21, 23))247         addSupportedSigAlg(
248                 OID_DIGEST_SHA384, OID_SIG_SHA256_WITH_DSA,
249                 InclusiveIntRange.fromTo(21, 23));
250 
addSupportedSigAlg( OID_DIGEST_SHA512, OID_SIG_SHA1_WITH_DSA, InclusiveIntRange.fromTo(21, 23))251         addSupportedSigAlg(
252                 OID_DIGEST_SHA512, OID_SIG_SHA1_WITH_DSA,
253                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA512, OID_SIG_SHA224_WITH_DSA, InclusiveIntRange.fromTo(21, 23))254         addSupportedSigAlg(
255                 OID_DIGEST_SHA512, OID_SIG_SHA224_WITH_DSA,
256                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA512, OID_SIG_SHA256_WITH_DSA, InclusiveIntRange.fromTo(21, 23))257         addSupportedSigAlg(
258                 OID_DIGEST_SHA512, OID_SIG_SHA256_WITH_DSA,
259                 InclusiveIntRange.fromTo(21, 23));
260 
addSupportedSigAlg( OID_DIGEST_SHA1, OID_SIG_EC_PUBLIC_KEY, InclusiveIntRange.from(18))261         addSupportedSigAlg(
262                 OID_DIGEST_SHA1, OID_SIG_EC_PUBLIC_KEY,
263                 InclusiveIntRange.from(18));
addSupportedSigAlg( OID_DIGEST_SHA224, OID_SIG_EC_PUBLIC_KEY, InclusiveIntRange.from(21))264         addSupportedSigAlg(
265                 OID_DIGEST_SHA224, OID_SIG_EC_PUBLIC_KEY,
266                 InclusiveIntRange.from(21));
addSupportedSigAlg( OID_DIGEST_SHA256, OID_SIG_EC_PUBLIC_KEY, InclusiveIntRange.from(18))267         addSupportedSigAlg(
268                 OID_DIGEST_SHA256, OID_SIG_EC_PUBLIC_KEY,
269                 InclusiveIntRange.from(18));
addSupportedSigAlg( OID_DIGEST_SHA384, OID_SIG_EC_PUBLIC_KEY, InclusiveIntRange.from(18))270         addSupportedSigAlg(
271                 OID_DIGEST_SHA384, OID_SIG_EC_PUBLIC_KEY,
272                 InclusiveIntRange.from(18));
addSupportedSigAlg( OID_DIGEST_SHA512, OID_SIG_EC_PUBLIC_KEY, InclusiveIntRange.from(18))273         addSupportedSigAlg(
274                 OID_DIGEST_SHA512, OID_SIG_EC_PUBLIC_KEY,
275                 InclusiveIntRange.from(18));
276 
addSupportedSigAlg( OID_DIGEST_MD5, OID_SIG_SHA1_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))277         addSupportedSigAlg(
278                 OID_DIGEST_MD5, OID_SIG_SHA1_WITH_ECDSA,
279                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_MD5, OID_SIG_SHA224_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))280         addSupportedSigAlg(
281                 OID_DIGEST_MD5, OID_SIG_SHA224_WITH_ECDSA,
282                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_MD5, OID_SIG_SHA256_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))283         addSupportedSigAlg(
284                 OID_DIGEST_MD5, OID_SIG_SHA256_WITH_ECDSA,
285                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_MD5, OID_SIG_SHA384_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))286         addSupportedSigAlg(
287                 OID_DIGEST_MD5, OID_SIG_SHA384_WITH_ECDSA,
288                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_MD5, OID_SIG_SHA512_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))289         addSupportedSigAlg(
290                 OID_DIGEST_MD5, OID_SIG_SHA512_WITH_ECDSA,
291                 InclusiveIntRange.fromTo(21, 23));
292 
addSupportedSigAlg( OID_DIGEST_SHA1, OID_SIG_SHA1_WITH_ECDSA, InclusiveIntRange.from(18))293         addSupportedSigAlg(
294                 OID_DIGEST_SHA1, OID_SIG_SHA1_WITH_ECDSA,
295                 InclusiveIntRange.from(18));
addSupportedSigAlg( OID_DIGEST_SHA1, OID_SIG_SHA224_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))296         addSupportedSigAlg(
297                 OID_DIGEST_SHA1, OID_SIG_SHA224_WITH_ECDSA,
298                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA1, OID_SIG_SHA256_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))299         addSupportedSigAlg(
300                 OID_DIGEST_SHA1, OID_SIG_SHA256_WITH_ECDSA,
301                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA1, OID_SIG_SHA384_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))302         addSupportedSigAlg(
303                 OID_DIGEST_SHA1, OID_SIG_SHA384_WITH_ECDSA,
304                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA1, OID_SIG_SHA512_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))305         addSupportedSigAlg(
306                 OID_DIGEST_SHA1, OID_SIG_SHA512_WITH_ECDSA,
307                 InclusiveIntRange.fromTo(21, 23));
308 
addSupportedSigAlg( OID_DIGEST_SHA224, OID_SIG_SHA1_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))309         addSupportedSigAlg(
310                 OID_DIGEST_SHA224, OID_SIG_SHA1_WITH_ECDSA,
311                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA224, OID_SIG_SHA224_WITH_ECDSA, InclusiveIntRange.from(21))312         addSupportedSigAlg(
313                 OID_DIGEST_SHA224, OID_SIG_SHA224_WITH_ECDSA,
314                 InclusiveIntRange.from(21));
addSupportedSigAlg( OID_DIGEST_SHA224, OID_SIG_SHA256_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))315         addSupportedSigAlg(
316                 OID_DIGEST_SHA224, OID_SIG_SHA256_WITH_ECDSA,
317                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA224, OID_SIG_SHA384_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))318         addSupportedSigAlg(
319                 OID_DIGEST_SHA224, OID_SIG_SHA384_WITH_ECDSA,
320                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA224, OID_SIG_SHA512_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))321         addSupportedSigAlg(
322                 OID_DIGEST_SHA224, OID_SIG_SHA512_WITH_ECDSA,
323                 InclusiveIntRange.fromTo(21, 23));
324 
addSupportedSigAlg( OID_DIGEST_SHA256, OID_SIG_SHA1_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))325         addSupportedSigAlg(
326                 OID_DIGEST_SHA256, OID_SIG_SHA1_WITH_ECDSA,
327                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA256, OID_SIG_SHA224_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))328         addSupportedSigAlg(
329                 OID_DIGEST_SHA256, OID_SIG_SHA224_WITH_ECDSA,
330                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA256, OID_SIG_SHA256_WITH_ECDSA, InclusiveIntRange.from(21))331         addSupportedSigAlg(
332                 OID_DIGEST_SHA256, OID_SIG_SHA256_WITH_ECDSA,
333                 InclusiveIntRange.from(21));
addSupportedSigAlg( OID_DIGEST_SHA256, OID_SIG_SHA384_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))334         addSupportedSigAlg(
335                 OID_DIGEST_SHA256, OID_SIG_SHA384_WITH_ECDSA,
336                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA256, OID_SIG_SHA512_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))337         addSupportedSigAlg(
338                 OID_DIGEST_SHA256, OID_SIG_SHA512_WITH_ECDSA,
339                 InclusiveIntRange.fromTo(21, 23));
340 
addSupportedSigAlg( OID_DIGEST_SHA384, OID_SIG_SHA1_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))341         addSupportedSigAlg(
342                 OID_DIGEST_SHA384, OID_SIG_SHA1_WITH_ECDSA,
343                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA384, OID_SIG_SHA224_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))344         addSupportedSigAlg(
345                 OID_DIGEST_SHA384, OID_SIG_SHA224_WITH_ECDSA,
346                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA384, OID_SIG_SHA256_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))347         addSupportedSigAlg(
348                 OID_DIGEST_SHA384, OID_SIG_SHA256_WITH_ECDSA,
349                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA384, OID_SIG_SHA384_WITH_ECDSA, InclusiveIntRange.from(21))350         addSupportedSigAlg(
351                 OID_DIGEST_SHA384, OID_SIG_SHA384_WITH_ECDSA,
352                 InclusiveIntRange.from(21));
addSupportedSigAlg( OID_DIGEST_SHA384, OID_SIG_SHA512_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))353         addSupportedSigAlg(
354                 OID_DIGEST_SHA384, OID_SIG_SHA512_WITH_ECDSA,
355                 InclusiveIntRange.fromTo(21, 23));
356 
addSupportedSigAlg( OID_DIGEST_SHA512, OID_SIG_SHA1_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))357         addSupportedSigAlg(
358                 OID_DIGEST_SHA512, OID_SIG_SHA1_WITH_ECDSA,
359                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA512, OID_SIG_SHA224_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))360         addSupportedSigAlg(
361                 OID_DIGEST_SHA512, OID_SIG_SHA224_WITH_ECDSA,
362                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA512, OID_SIG_SHA256_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))363         addSupportedSigAlg(
364                 OID_DIGEST_SHA512, OID_SIG_SHA256_WITH_ECDSA,
365                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA512, OID_SIG_SHA384_WITH_ECDSA, InclusiveIntRange.fromTo(21, 23))366         addSupportedSigAlg(
367                 OID_DIGEST_SHA512, OID_SIG_SHA384_WITH_ECDSA,
368                 InclusiveIntRange.fromTo(21, 23));
addSupportedSigAlg( OID_DIGEST_SHA512, OID_SIG_SHA512_WITH_ECDSA, InclusiveIntRange.from(21))369         addSupportedSigAlg(
370                 OID_DIGEST_SHA512, OID_SIG_SHA512_WITH_ECDSA,
371                 InclusiveIntRange.from(21));
372     }
373 
addSupportedSigAlg( String digestAlgorithmOid, String signatureAlgorithmOid, InclusiveIntRange... supportedApiLevels)374     public static void addSupportedSigAlg(
375             String digestAlgorithmOid,
376             String signatureAlgorithmOid,
377             InclusiveIntRange... supportedApiLevels) {
378         SUPPORTED_SIG_ALG_OIDS.put(
379                 digestAlgorithmOid + "with" + signatureAlgorithmOid,
380                 Arrays.asList(supportedApiLevels));
381     }
382 
getSigAlgSupportedApiLevels( String digestAlgorithmOid, String signatureAlgorithmOid)383     public static List<InclusiveIntRange> getSigAlgSupportedApiLevels(
384             String digestAlgorithmOid,
385             String signatureAlgorithmOid) {
386         List<InclusiveIntRange> result =
387                 SUPPORTED_SIG_ALG_OIDS.get(digestAlgorithmOid + "with" + signatureAlgorithmOid);
388         return (result != null) ? result : Collections.emptyList();
389     }
390 
391     public static class OidToUserFriendlyNameMapper {
OidToUserFriendlyNameMapper()392         private OidToUserFriendlyNameMapper() {}
393 
394         private static final Map<String, String> OID_TO_USER_FRIENDLY_NAME = new HashMap<>();
395         static {
OID_TO_USER_FRIENDLY_NAME.put(OID_DIGEST_MD5, "MD5")396             OID_TO_USER_FRIENDLY_NAME.put(OID_DIGEST_MD5, "MD5");
OID_TO_USER_FRIENDLY_NAME.put(OID_DIGEST_SHA1, "SHA-1")397             OID_TO_USER_FRIENDLY_NAME.put(OID_DIGEST_SHA1, "SHA-1");
OID_TO_USER_FRIENDLY_NAME.put(OID_DIGEST_SHA224, "SHA-224")398             OID_TO_USER_FRIENDLY_NAME.put(OID_DIGEST_SHA224, "SHA-224");
OID_TO_USER_FRIENDLY_NAME.put(OID_DIGEST_SHA256, "SHA-256")399             OID_TO_USER_FRIENDLY_NAME.put(OID_DIGEST_SHA256, "SHA-256");
OID_TO_USER_FRIENDLY_NAME.put(OID_DIGEST_SHA384, "SHA-384")400             OID_TO_USER_FRIENDLY_NAME.put(OID_DIGEST_SHA384, "SHA-384");
OID_TO_USER_FRIENDLY_NAME.put(OID_DIGEST_SHA512, "SHA-512")401             OID_TO_USER_FRIENDLY_NAME.put(OID_DIGEST_SHA512, "SHA-512");
402 
OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_RSA, "RSA")403             OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_RSA, "RSA");
OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_MD5_WITH_RSA, "MD5 with RSA")404             OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_MD5_WITH_RSA, "MD5 with RSA");
OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA1_WITH_RSA, "SHA-1 with RSA")405             OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA1_WITH_RSA, "SHA-1 with RSA");
OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA224_WITH_RSA, "SHA-224 with RSA")406             OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA224_WITH_RSA, "SHA-224 with RSA");
OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA256_WITH_RSA, "SHA-256 with RSA")407             OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA256_WITH_RSA, "SHA-256 with RSA");
OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA384_WITH_RSA, "SHA-384 with RSA")408             OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA384_WITH_RSA, "SHA-384 with RSA");
OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA512_WITH_RSA, "SHA-512 with RSA")409             OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA512_WITH_RSA, "SHA-512 with RSA");
410 
411 
OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_DSA, "DSA")412             OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_DSA, "DSA");
OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA1_WITH_DSA, "SHA-1 with DSA")413             OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA1_WITH_DSA, "SHA-1 with DSA");
OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA224_WITH_DSA, "SHA-224 with DSA")414             OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA224_WITH_DSA, "SHA-224 with DSA");
OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA256_WITH_DSA, "SHA-256 with DSA")415             OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA256_WITH_DSA, "SHA-256 with DSA");
OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA384_WITH_DSA, "SHA-384 with DSA")416             OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA384_WITH_DSA, "SHA-384 with DSA");
OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA512_WITH_DSA, "SHA-512 with DSA")417             OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA512_WITH_DSA, "SHA-512 with DSA");
418 
OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_EC_PUBLIC_KEY, "ECDSA")419             OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_EC_PUBLIC_KEY, "ECDSA");
OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA1_WITH_ECDSA, "SHA-1 with ECDSA")420             OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA1_WITH_ECDSA, "SHA-1 with ECDSA");
OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA224_WITH_ECDSA, "SHA-224 with ECDSA")421             OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA224_WITH_ECDSA, "SHA-224 with ECDSA");
OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA256_WITH_ECDSA, "SHA-256 with ECDSA")422             OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA256_WITH_ECDSA, "SHA-256 with ECDSA");
OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA384_WITH_ECDSA, "SHA-384 with ECDSA")423             OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA384_WITH_ECDSA, "SHA-384 with ECDSA");
OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA512_WITH_ECDSA, "SHA-512 with ECDSA")424             OID_TO_USER_FRIENDLY_NAME.put(OID_SIG_SHA512_WITH_ECDSA, "SHA-512 with ECDSA");
425         }
426 
getUserFriendlyNameForOid(String oid)427         public static String getUserFriendlyNameForOid(String oid) {
428             return OID_TO_USER_FRIENDLY_NAME.get(oid);
429         }
430     }
431 
432     public static final Map<String, String> OID_TO_JCA_DIGEST_ALG = new HashMap<>();
433     static {
OID_TO_JCA_DIGEST_ALG.put(OID_DIGEST_MD5, "MD5")434         OID_TO_JCA_DIGEST_ALG.put(OID_DIGEST_MD5, "MD5");
OID_TO_JCA_DIGEST_ALG.put(OID_DIGEST_SHA1, "SHA-1")435         OID_TO_JCA_DIGEST_ALG.put(OID_DIGEST_SHA1, "SHA-1");
OID_TO_JCA_DIGEST_ALG.put(OID_DIGEST_SHA224, "SHA-224")436         OID_TO_JCA_DIGEST_ALG.put(OID_DIGEST_SHA224, "SHA-224");
OID_TO_JCA_DIGEST_ALG.put(OID_DIGEST_SHA256, "SHA-256")437         OID_TO_JCA_DIGEST_ALG.put(OID_DIGEST_SHA256, "SHA-256");
OID_TO_JCA_DIGEST_ALG.put(OID_DIGEST_SHA384, "SHA-384")438         OID_TO_JCA_DIGEST_ALG.put(OID_DIGEST_SHA384, "SHA-384");
OID_TO_JCA_DIGEST_ALG.put(OID_DIGEST_SHA512, "SHA-512")439         OID_TO_JCA_DIGEST_ALG.put(OID_DIGEST_SHA512, "SHA-512");
440     }
441 
442     public static final Map<String, String> OID_TO_JCA_SIGNATURE_ALG = new HashMap<>();
443     static {
OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_MD5_WITH_RSA, "MD5withRSA")444         OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_MD5_WITH_RSA, "MD5withRSA");
OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA1_WITH_RSA, "SHA1withRSA")445         OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA1_WITH_RSA, "SHA1withRSA");
OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA224_WITH_RSA, "SHA224withRSA")446         OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA224_WITH_RSA, "SHA224withRSA");
OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA256_WITH_RSA, "SHA256withRSA")447         OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA256_WITH_RSA, "SHA256withRSA");
OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA384_WITH_RSA, "SHA384withRSA")448         OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA384_WITH_RSA, "SHA384withRSA");
OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA512_WITH_RSA, "SHA512withRSA")449         OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA512_WITH_RSA, "SHA512withRSA");
450 
OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA1_WITH_DSA, "SHA1withDSA")451         OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA1_WITH_DSA, "SHA1withDSA");
OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA224_WITH_DSA, "SHA224withDSA")452         OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA224_WITH_DSA, "SHA224withDSA");
OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA256_WITH_DSA, "SHA256withDSA")453         OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA256_WITH_DSA, "SHA256withDSA");
454 
OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA1_WITH_ECDSA, "SHA1withECDSA")455         OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA1_WITH_ECDSA, "SHA1withECDSA");
OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA224_WITH_ECDSA, "SHA224withECDSA")456         OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA224_WITH_ECDSA, "SHA224withECDSA");
OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA256_WITH_ECDSA, "SHA256withECDSA")457         OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA256_WITH_ECDSA, "SHA256withECDSA");
OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA384_WITH_ECDSA, "SHA384withECDSA")458         OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA384_WITH_ECDSA, "SHA384withECDSA");
OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA512_WITH_ECDSA, "SHA512withECDSA")459         OID_TO_JCA_SIGNATURE_ALG.put(OID_SIG_SHA512_WITH_ECDSA, "SHA512withECDSA");
460     }
461 
OidConstants()462     private OidConstants() {}
463 }
464