summaryrefslogtreecommitdiff
path: root/keystore/java/android/security/AndroidKeyPairGenerator.java
diff options
context:
space:
mode:
authorKenny Root <kroot@google.com>2015-04-24 22:13:26 +0000
committerAndroid Git Automerger <android-git-automerger@android.com>2015-04-24 22:13:26 +0000
commit22335a9730d80c7282f2a10d617136702850c56f (patch)
treebe187df10b3e4afc4254c6b471b69f972b51f294 /keystore/java/android/security/AndroidKeyPairGenerator.java
parent96778220979cc0029d6f8bba98ca87b5dadeda12 (diff)
parent6c1af7ea497b1a2f04bdf45a19d2147f5b9665b9 (diff)
am 6c1af7ea: am 8652bce1: am c71f2648: Merge "frameworks/base: switch to using NativeConstants."
* commit '6c1af7ea497b1a2f04bdf45a19d2147f5b9665b9': frameworks/base: switch to using NativeConstants.
Diffstat (limited to 'keystore/java/android/security/AndroidKeyPairGenerator.java')
-rw-r--r--keystore/java/android/security/AndroidKeyPairGenerator.java14
1 files changed, 7 insertions, 7 deletions
diff --git a/keystore/java/android/security/AndroidKeyPairGenerator.java b/keystore/java/android/security/AndroidKeyPairGenerator.java
index 5fae831de8d7..3b25ba66b9c3 100644
--- a/keystore/java/android/security/AndroidKeyPairGenerator.java
+++ b/keystore/java/android/security/AndroidKeyPairGenerator.java
@@ -17,7 +17,7 @@
package android.security;
import com.android.org.bouncycastle.x509.X509V3CertificateGenerator;
-import com.android.org.conscrypt.NativeCrypto;
+import com.android.org.conscrypt.NativeConstants;
import com.android.org.conscrypt.OpenSSLEngine;
import java.security.InvalidAlgorithmParameterException;
@@ -206,9 +206,9 @@ public abstract class AndroidKeyPairGenerator extends KeyPairGeneratorSpi {
}
private static int getDefaultKeySize(int keyType) {
- if (keyType == NativeCrypto.EVP_PKEY_EC) {
+ if (keyType == NativeConstants.EVP_PKEY_EC) {
return EC_DEFAULT_KEY_SIZE;
- } else if (keyType == NativeCrypto.EVP_PKEY_RSA) {
+ } else if (keyType == NativeConstants.EVP_PKEY_RSA) {
return RSA_DEFAULT_KEY_SIZE;
}
return -1;
@@ -216,12 +216,12 @@ public abstract class AndroidKeyPairGenerator extends KeyPairGeneratorSpi {
private static void checkValidKeySize(String keyAlgorithm, int keyType, int keySize)
throws InvalidAlgorithmParameterException {
- if (keyType == NativeCrypto.EVP_PKEY_EC) {
+ if (keyType == NativeConstants.EVP_PKEY_EC) {
if (keySize < EC_MIN_KEY_SIZE || keySize > EC_MAX_KEY_SIZE) {
throw new InvalidAlgorithmParameterException("EC keys must be >= "
+ EC_MIN_KEY_SIZE + " and <= " + EC_MAX_KEY_SIZE);
}
- } else if (keyType == NativeCrypto.EVP_PKEY_RSA) {
+ } else if (keyType == NativeConstants.EVP_PKEY_RSA) {
if (keySize < RSA_MIN_KEY_SIZE || keySize > RSA_MAX_KEY_SIZE) {
throw new InvalidAlgorithmParameterException("RSA keys must be >= "
+ RSA_MIN_KEY_SIZE + " and <= " + RSA_MAX_KEY_SIZE);
@@ -234,7 +234,7 @@ public abstract class AndroidKeyPairGenerator extends KeyPairGeneratorSpi {
private static void checkCorrectParametersSpec(int keyType, int keySize,
AlgorithmParameterSpec spec) throws InvalidAlgorithmParameterException {
- if (keyType == NativeCrypto.EVP_PKEY_RSA && spec != null) {
+ if (keyType == NativeConstants.EVP_PKEY_RSA && spec != null) {
if (spec instanceof RSAKeyGenParameterSpec) {
RSAKeyGenParameterSpec rsaSpec = (RSAKeyGenParameterSpec) spec;
if (keySize != -1 && keySize != rsaSpec.getKeysize()) {
@@ -260,7 +260,7 @@ public abstract class AndroidKeyPairGenerator extends KeyPairGeneratorSpi {
private static byte[][] getArgsForKeyType(int keyType, AlgorithmParameterSpec spec) {
switch (keyType) {
- case NativeCrypto.EVP_PKEY_RSA:
+ case NativeConstants.EVP_PKEY_RSA:
if (spec instanceof RSAKeyGenParameterSpec) {
RSAKeyGenParameterSpec rsaSpec = (RSAKeyGenParameterSpec) spec;
return new byte[][] { rsaSpec.getPublicExponent().toByteArray() };