Commit 60947887 authored by Kenny Root's avatar Kenny Root Committed by Gerrit Code Review
Browse files

Merge "NativeCrypto: fix some DSA/ECDSA key generation"

parents 4ae5e176 8c4b6ac9
......@@ -72,7 +72,7 @@ public class OpenSSLDSAKeyFactory extends KeyFactorySpi {
throw new InvalidKeySpecException(e);
}
}
throw new InvalidKeySpecException("Must use DSAPublicKeySpec or PKCS8EncodedKeySpec; was "
throw new InvalidKeySpecException("Must use DSAPrivateKeySpec or PKCS8EncodedKeySpec; was "
+ keySpec.getClass().getName());
}
......@@ -158,7 +158,7 @@ public class OpenSSLDSAKeyFactory extends KeyFactorySpi {
BigInteger g = params.getG();
try {
return engineGeneratePublic(new DSAPrivateKeySpec(x, p, q, g));
return engineGeneratePrivate(new DSAPrivateKeySpec(x, p, q, g));
} catch (InvalidKeySpecException e) {
throw new InvalidKeyException(e);
}
......
......@@ -73,7 +73,7 @@ public class OpenSSLECKeyFactory extends KeyFactorySpi {
throw new InvalidKeySpecException(e);
}
}
throw new InvalidKeySpecException("Must use ECPublicKeySpec or PKCS8EncodedKeySpec; was "
throw new InvalidKeySpecException("Must use ECPrivateKeySpec or PKCS8EncodedKeySpec; was "
+ keySpec.getClass().getName());
}
......@@ -147,7 +147,7 @@ public class OpenSSLECKeyFactory extends KeyFactorySpi {
ECParameterSpec params = ecKey.getParams();
try {
return engineGeneratePublic(new ECPrivateKeySpec(s, params));
return engineGeneratePrivate(new ECPrivateKeySpec(s, params));
} catch (InvalidKeySpecException e) {
throw new InvalidKeyException(e);
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment