summaryrefslogtreecommitdiff
path: root/keystore/java/android/security/KeyPairGeneratorSpec.java
diff options
context:
space:
mode:
authorScott Lobdell <slobdell@google.com>2020-11-05 18:29:12 -0800
committerScott Lobdell <slobdell@google.com>2020-11-13 11:48:49 -0800
commit3933f277a025be704e68ea593536e492831a7e05 (patch)
tree084aa5e0858c449a63dd18cc57fb21ab054d363a /keystore/java/android/security/KeyPairGeneratorSpec.java
parent248a6ce2e2ee65f367b01c43edeecef5a6d57581 (diff)
parent9c74513b2d828d5169e9942b58b2f93bb3e04aff (diff)
Merge SP1A.201105.002
Change-Id: Iec83a0c1f6f286a1e51abfc4356633ca9d8aea5f
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);
}
}
}