summaryrefslogtreecommitdiff
path: root/keystore/java/android/security/KeyPairGeneratorSpec.java
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2020-11-03 02:12:16 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2020-11-03 02:12:16 +0000
commitd705a782be457bfda14b86bd6a5ef5fec044546a (patch)
tree99d27bdac1f86a21a8189673ed5d7d0471b9bce2 /keystore/java/android/security/KeyPairGeneratorSpec.java
parentabe608dcd8880f0909179961439867487947efb8 (diff)
parent8cd3f230bb9e7e6c6426c63bd068623c46806b89 (diff)
Snap for 6947132 from 8cd3f230bb9e7e6c6426c63bd068623c46806b89 to sc-release
Change-Id: I41b4a8cad5c5302f35532b81ffd771339d8f5300
Diffstat (limited to 'keystore/java/android/security/KeyPairGeneratorSpec.java')
-rw-r--r--keystore/java/android/security/KeyPairGeneratorSpec.java26
1 files changed, 16 insertions, 10 deletions
diff --git a/keystore/java/android/security/KeyPairGeneratorSpec.java b/keystore/java/android/security/KeyPairGeneratorSpec.java
index d5b34c432e79..1c1c2eeee794 100644
--- a/keystore/java/android/security/KeyPairGeneratorSpec.java
+++ b/keystore/java/android/security/KeyPairGeneratorSpec.java
@@ -16,9 +16,9 @@
package android.security;
-import android.app.KeyguardManager;
import android.annotation.NonNull;
import android.annotation.Nullable;
+import android.app.KeyguardManager;
import android.content.Context;
import android.security.keystore.KeyGenParameterSpec;
import android.security.keystore.KeyProperties;
@@ -78,8 +78,6 @@ public final class KeyPairGeneratorSpec implements AlgorithmParameterSpec {
private final Date mEndDate;
- private final int mFlags;
-
/**
* Parameter specification for the "{@code AndroidKeyPairGenerator}"
* instance of the {@link java.security.KeyPairGenerator} API. The
@@ -144,7 +142,6 @@ public final class KeyPairGeneratorSpec implements AlgorithmParameterSpec {
mSerialNumber = serialNumber;
mStartDate = startDate;
mEndDate = endDate;
- mFlags = flags;
}
/**
@@ -229,7 +226,7 @@ public final class KeyPairGeneratorSpec implements AlgorithmParameterSpec {
* @hide
*/
public int getFlags() {
- return mFlags;
+ return 0;
}
/**
@@ -243,9 +240,15 @@ public final class KeyPairGeneratorSpec implements AlgorithmParameterSpec {
* screen after boot.
*
* @see KeyguardManager#isDeviceSecure()
+ *
+ * @deprecated Encryption at rest is on by default. If extra binding to the lockscreen screen
+ * credential is desired use
+ * {@link KeyGenParameterSpec.Builder#setUserAuthenticationRequired(boolean)}.
+ * This flag will be ignored from Android S.
*/
+ @Deprecated
public boolean isEncryptionRequired() {
- return (mFlags & KeyStore.FLAG_ENCRYPTED) != 0;
+ return false;
}
/**
@@ -292,8 +295,6 @@ public final class KeyPairGeneratorSpec implements AlgorithmParameterSpec {
private Date mEndDate;
- private int mFlags;
-
/**
* Creates a new instance of the {@code Builder} with the given
* {@code context}. The {@code context} passed in may be used to pop up
@@ -431,10 +432,15 @@ public final class KeyPairGeneratorSpec implements AlgorithmParameterSpec {
* secure lock screen after boot.
*
* @see KeyguardManager#isDeviceSecure()
+ *
+ * @deprecated Data at rest encryption is enabled by default. If extra binding to the
+ * lockscreen credential is desired, use
+ * {@link KeyGenParameterSpec.Builder#setUserAuthenticationRequired(boolean)}.
+ * This flag will be ignored from Android S.
*/
@NonNull
+ @Deprecated
public Builder setEncryptionRequired() {
- mFlags |= KeyStore.FLAG_ENCRYPTED;
return this;
}
@@ -455,7 +461,7 @@ public final class KeyPairGeneratorSpec implements AlgorithmParameterSpec {
mSerialNumber,
mStartDate,
mEndDate,
- mFlags);
+ 0);
}
}
}