Skip to content

Commit 90a3b17

Browse files
committed
Add TODO comments to key factories
1 parent 90cee3c commit 90a3b17

2 files changed

Lines changed: 12 additions & 0 deletions

File tree

core/src/main/java/org/bouncycastle/crypto/util/PrivateKeyFactory.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,8 +152,16 @@ else if (algOID.equals(X9ObjectIdentifiers.id_dsa))
152152

153153
return new DSAPrivateKeyParameters(derX.getValue(), parameters);
154154
}
155+
/*
156+
* TODO id-ecDH (SECObjectIdentifiers.ecdh) and/or id-ecMQV (SECObjectIdentifiers.ecmqv) could be supported if
157+
* we could properly restrict usage of the resulting key.
158+
*/
155159
else if (algOID.equals(X9ObjectIdentifiers.id_ecPublicKey))
156160
{
161+
/*
162+
* TODO Consistency checks in case parameters and/or public key are specified at both the
163+
* PrivateKeyInfo and ECPrivateKey levels?
164+
*/
157165
ECPrivateKey ecPrivateKey = ECPrivateKey.getInstance(keyInfo.parsePrivateKey());
158166

159167
X962Parameters parameters = X962Parameters.getInstance(algId.getParameters().toASN1Primitive());

core/src/main/java/org/bouncycastle/crypto/util/PublicKeyFactory.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ public class PublicKeyFactory
8181
converters.put(X9ObjectIdentifiers.id_dsa, new DSAConverter());
8282
converters.put(OIWObjectIdentifiers.dsaWithSHA1, new DSAConverter());
8383
converters.put(OIWObjectIdentifiers.elGamalAlgorithm, new ElGamalConverter());
84+
/*
85+
* TODO id-ecDH (SECObjectIdentifiers.ecdh) and/or id-ecMQV (SECObjectIdentifiers.ecmqv) could be supported if
86+
* we could properly restrict usage of the resulting key.
87+
*/
8488
converters.put(X9ObjectIdentifiers.id_ecPublicKey, new ECConverter());
8589
converters.put(CryptoProObjectIdentifiers.gostR3410_2001, new GOST3410_2001Converter());
8690
converters.put(RosstandartObjectIdentifiers.id_tc26_gost_3410_12_256, new GOST3410_2012Converter());

0 commit comments

Comments
 (0)