diff options
author | Alex Klyubin <klyubin@google.com> | 2015-04-13 10:20:24 -0700 |
---|---|---|
committer | Alex Klyubin <klyubin@google.com> | 2015-04-13 10:20:24 -0700 |
commit | 33454dd5698bf5c9767d126ffafa26672e8d5a14 (patch) | |
tree | 0f7717ac8106633275805cbdee46451bd019d883 /keystore/java | |
parent | d1af38a4783c1c0d1a5b7c76a7583beb02a88462 (diff) | |
download | frameworks_base-33454dd5698bf5c9767d126ffafa26672e8d5a14.zip frameworks_base-33454dd5698bf5c9767d126ffafa26672e8d5a14.tar.gz frameworks_base-33454dd5698bf5c9767d126ffafa26672e8d5a14.tar.bz2 |
No need to specify EC curve name in EcIesParameterSpec.
EC curve parameters will be obtained from the provided EC key.
Bug: 18088752
Change-Id: Ic99353a6566c8d4ce2b6b73d0309edaa40f84fa6
Diffstat (limited to 'keystore/java')
-rw-r--r-- | keystore/java/android/security/EcIesParameterSpec.java | 27 |
1 files changed, 2 insertions, 25 deletions
diff --git a/keystore/java/android/security/EcIesParameterSpec.java b/keystore/java/android/security/EcIesParameterSpec.java index 0f19812..3372da9 100644 --- a/keystore/java/android/security/EcIesParameterSpec.java +++ b/keystore/java/android/security/EcIesParameterSpec.java @@ -85,11 +85,10 @@ public class EcIesParameterSpec implements AlgorithmParameterSpec { } /** - * Default parameter spec: NIST P-256 curve (aka secp256r1 aka prime256v1), compressed point - * format, {@code HKDFwithSHA256}, DEM uses 128-bit AES GCM. + * Default parameter spec: compressed point format, {@code HKDFwithSHA256}, DEM uses 128-bit AES + * GCM. */ public static final EcIesParameterSpec DEFAULT = new EcIesParameterSpec( - "P-256", PointFormat.COMPRESSED, "HKDFwithSHA256", "AES/GCM/NoPadding", @@ -97,7 +96,6 @@ public class EcIesParameterSpec implements AlgorithmParameterSpec { null, 0); - private final String mKemCurveName; private final @PointFormatEnum int mKemPointFormat; private final String mKemKdfAlgorithm; private final String mDemCipherTransformation; @@ -106,14 +104,12 @@ public class EcIesParameterSpec implements AlgorithmParameterSpec { private final int mDemMacKeySize; private EcIesParameterSpec( - String kemCurveName, @PointFormatEnum int kemPointFormat, String kemKdfAlgorithm, String demCipherTransformation, int demCipherKeySize, String demMacAlgorithm, int demMacKeySize) { - mKemCurveName = kemCurveName; mKemPointFormat = kemPointFormat; mKemKdfAlgorithm = kemKdfAlgorithm; mDemCipherTransformation = demCipherTransformation; @@ -123,13 +119,6 @@ public class EcIesParameterSpec implements AlgorithmParameterSpec { } /** - * Returns KEM EC curve name (e.g., {@code secp256r1}) or {@code null} if not specified. - */ - public String getKemCurveName() { - return mKemCurveName; - } - - /** * Returns KEM EC point wire format or {@link PointFormat#UNSPECIFIED} if not specified. */ public @PointFormatEnum int getKemPointFormat() { @@ -188,7 +177,6 @@ public class EcIesParameterSpec implements AlgorithmParameterSpec { * Builder of {@link EcIesParameterSpec}. */ public static class Builder { - private String mKemCurveName; private @PointFormatEnum int mKemPointFormat = PointFormat.UNSPECIFIED; private String mKemKdfAlgorithm; private String mDemCipherTransformation; @@ -197,16 +185,6 @@ public class EcIesParameterSpec implements AlgorithmParameterSpec { private int mDemMacKeySize = -1; /** - * Sets KEM EC curve name. For example, {@code P-256} or {@code secp256r1}. - * - * <p>NOTE: Only curves with cofactor of {@code 1} are supported. - */ - public Builder setKemCurveName(String name) { - mKemCurveName = name; - return this; - } - - /** * Sets KEM EC point wire format. */ public Builder setKemPointFormat(@PointFormatEnum int pointFormat) { @@ -274,7 +252,6 @@ public class EcIesParameterSpec implements AlgorithmParameterSpec { public EcIesParameterSpec build() { int demMacKeySize = (mDemMacKeySize != -1) ? mDemMacKeySize : mDemCipherKeySize; return new EcIesParameterSpec( - mKemCurveName, mKemPointFormat, mKemKdfAlgorithm, mDemCipherTransformation, |