58 |
61 |
59 map.put("AlgorithmParameters.EC KeySize", "256"); |
62 map.put("AlgorithmParameters.EC KeySize", "256"); |
60 |
63 |
61 map.put("AlgorithmParameters.EC ImplementedIn", "Software"); |
64 map.put("AlgorithmParameters.EC ImplementedIn", "Software"); |
62 |
65 |
63 map.put("AlgorithmParameters.EC SupportedCurves", |
66 // "AlgorithmParameters.EC SupportedCurves" prop used by unit test |
|
67 boolean firstCurve = true; |
|
68 StringBuilder names = new StringBuilder(); |
|
69 Pattern nameSplitPattern = Pattern.compile(CurveDB.SPLIT_PATTERN); |
64 |
70 |
65 // A list comprising lists of curve names and object identifiers. |
71 Collection<? extends NamedCurve> supportedCurves = |
66 // '[' ( <curve-name> ',' )+ <curve-object-identifier> ']' '|' |
72 CurveDB.getSupportedCurves(); |
|
73 for (NamedCurve namedCurve : supportedCurves) { |
|
74 if (!firstCurve) { |
|
75 names.append("|"); |
|
76 } else { |
|
77 firstCurve = false; |
|
78 } |
67 |
79 |
68 // SEC 2 prime curves |
80 names.append("["); |
69 "[secp112r1,1.3.132.0.6]|" + |
|
70 "[secp112r2,1.3.132.0.7]|" + |
|
71 "[secp128r1,1.3.132.0.28]|" + |
|
72 "[secp128r2,1.3.132.0.29]|" + |
|
73 "[secp160k1,1.3.132.0.9]|" + |
|
74 "[secp160r1,1.3.132.0.8]|" + |
|
75 "[secp160r2,1.3.132.0.30]|" + |
|
76 "[secp192k1,1.3.132.0.31]|" + |
|
77 "[secp192r1,NIST P-192,X9.62 prime192v1,1.2.840.10045.3.1.1]|" + |
|
78 "[secp224k1,1.3.132.0.32]|" + |
|
79 "[secp224r1,NIST P-224,1.3.132.0.33]|" + |
|
80 "[secp256k1,1.3.132.0.10]|" + |
|
81 "[secp256r1,NIST P-256,X9.62 prime256v1,1.2.840.10045.3.1.7]|" + |
|
82 "[secp384r1,NIST P-384,1.3.132.0.34]|" + |
|
83 "[secp521r1,NIST P-521,1.3.132.0.35]|" + |
|
84 |
81 |
85 // ANSI X9.62 prime curves |
82 String[] commonNames = nameSplitPattern.split(namedCurve.getName()); |
86 "[X9.62 prime192v2,1.2.840.10045.3.1.2]|" + |
83 for (String commonName : commonNames) { |
87 "[X9.62 prime192v3,1.2.840.10045.3.1.3]|" + |
84 names.append(commonName.trim()); |
88 "[X9.62 prime239v1,1.2.840.10045.3.1.4]|" + |
85 names.append(","); |
89 "[X9.62 prime239v2,1.2.840.10045.3.1.5]|" + |
86 } |
90 "[X9.62 prime239v3,1.2.840.10045.3.1.6]|" + |
|
91 |
87 |
92 // SEC 2 binary curves |
88 names.append(namedCurve.getObjectId()); |
93 "[sect113r1,1.3.132.0.4]|" + |
89 names.append("]"); |
94 "[sect113r2,1.3.132.0.5]|" + |
90 } |
95 "[sect131r1,1.3.132.0.22]|" + |
|
96 "[sect131r2,1.3.132.0.23]|" + |
|
97 "[sect163k1,NIST K-163,1.3.132.0.1]|" + |
|
98 "[sect163r1,1.3.132.0.2]|" + |
|
99 "[sect163r2,NIST B-163,1.3.132.0.15]|" + |
|
100 "[sect193r1,1.3.132.0.24]|" + |
|
101 "[sect193r2,1.3.132.0.25]|" + |
|
102 "[sect233k1,NIST K-233,1.3.132.0.26]|" + |
|
103 "[sect233r1,NIST B-233,1.3.132.0.27]|" + |
|
104 "[sect239k1,1.3.132.0.3]|" + |
|
105 "[sect283k1,NIST K-283,1.3.132.0.16]|" + |
|
106 "[sect283r1,NIST B-283,1.3.132.0.17]|" + |
|
107 "[sect409k1,NIST K-409,1.3.132.0.36]|" + |
|
108 "[sect409r1,NIST B-409,1.3.132.0.37]|" + |
|
109 "[sect571k1,NIST K-571,1.3.132.0.38]|" + |
|
110 "[sect571r1,NIST B-571,1.3.132.0.39]|" + |
|
111 |
91 |
112 // ANSI X9.62 binary curves |
92 map.put("AlgorithmParameters.EC SupportedCurves", names.toString()); |
113 "[X9.62 c2tnb191v1,1.2.840.10045.3.0.5]|" + |
|
114 "[X9.62 c2tnb191v2,1.2.840.10045.3.0.6]|" + |
|
115 "[X9.62 c2tnb191v3,1.2.840.10045.3.0.7]|" + |
|
116 "[X9.62 c2tnb239v1,1.2.840.10045.3.0.11]|" + |
|
117 "[X9.62 c2tnb239v2,1.2.840.10045.3.0.12]|" + |
|
118 "[X9.62 c2tnb239v3,1.2.840.10045.3.0.13]|" + |
|
119 "[X9.62 c2tnb359v1,1.2.840.10045.3.0.18]|" + |
|
120 "[X9.62 c2tnb431r1,1.2.840.10045.3.0.20]"); |
|
121 |
93 |
122 /* |
94 /* |
123 * Register the algorithms below only when the full ECC implementation |
95 * Register the algorithms below only when the full ECC implementation |
124 * is available |
96 * is available |
125 */ |
97 */ |