summaryrefslogtreecommitdiffstats
path: root/keystore/java/android
diff options
context:
space:
mode:
Diffstat (limited to 'keystore/java/android')
-rw-r--r--keystore/java/android/security/EcIesParameterSpec.java57
-rw-r--r--keystore/java/android/security/KeyStoreKeyProperties.java21
2 files changed, 47 insertions, 31 deletions
diff --git a/keystore/java/android/security/EcIesParameterSpec.java b/keystore/java/android/security/EcIesParameterSpec.java
index af93519..1cd8784 100644
--- a/keystore/java/android/security/EcIesParameterSpec.java
+++ b/keystore/java/android/security/EcIesParameterSpec.java
@@ -51,49 +51,44 @@ import javax.crypto.Mac;
*/
public class EcIesParameterSpec implements AlgorithmParameterSpec {
+ /**
+ * @hide
+ */
@Retention(RetentionPolicy.SOURCE)
@IntDef({
- PointFormat.UNSPECIFIED,
- PointFormat.UNCOMPRESSED,
- PointFormat.COMPRESSED,
+ POINT_FORMAT_UNSPECIFIED,
+ POINT_FORMAT_UNCOMPRESSED,
+ POINT_FORMAT_COMPRESSED,
})
public @interface PointFormatEnum {}
+ /** Unspecified EC point format. */
+ public static final int POINT_FORMAT_UNSPECIFIED = -1;
+
/**
- * Wire format of the EC point.
+ * Uncompressed EC point format: both coordinates are stored separately.
+ *
+ * <p>The wire format is byte {@code 0x04} followed by binary representation of the {@code x}
+ * coordinate followed by binary representation of the {@code y} coordinate. See
+ * {@code ISO 18033-2} section {@code 5.4.3}.
*/
- public static abstract class PointFormat {
-
- private PointFormat() {}
+ public static final int POINT_FORMAT_UNCOMPRESSED = 0;
- /** Unspecified point format. */
- public static final int UNSPECIFIED = -1;
-
- /**
- * Uncompressed point format: both coordinates are stored separately.
- *
- * <p>The wire format is byte {@code 0x04} followed by binary representation of the
- * {@code x} coordinate followed by binary representation of the {@code y} coordinate. See
- * {@code ISO 18033-2} section {@code 5.4.3}.
- */
- public static final int UNCOMPRESSED = 0;
-
- /**
- * Compressed point format: only one coordinate is stored.
- *
- * <p>The wire format is byte {@code 0x02} or {@code 0x03} (depending on the value of the
- * stored coordinate) followed by the binary representation of the {@code x} coordinate.
- * See {@code ISO 18033-2} section {@code 5.4.3}.
- */
- public static final int COMPRESSED = 1;
- }
+ /**
+ * Compressed EC point format: only one coordinate is stored.
+ *
+ * <p>The wire format is byte {@code 0x02} or {@code 0x03} (depending on the value of the stored
+ * coordinate) followed by the binary representation of the {@code x} coordinate. See
+ * {@code ISO 18033-2} section {@code 5.4.3}.
+ */
+ public static final int POINT_FORMAT_COMPRESSED = 1;
/**
* Default parameter spec: compressed point format, {@code HKDFwithSHA256}, DEM uses 128-bit AES
* GCM.
*/
public static final EcIesParameterSpec DEFAULT = new EcIesParameterSpec(
- PointFormat.COMPRESSED,
+ POINT_FORMAT_COMPRESSED,
"HKDFwithSHA256",
"AES/GCM/NoPadding",
128,
@@ -123,7 +118,7 @@ public class EcIesParameterSpec implements AlgorithmParameterSpec {
}
/**
- * Returns KEM EC point wire format or {@link PointFormat#UNSPECIFIED} if not specified.
+ * Returns KEM EC point wire format or {@link #POINT_FORMAT_UNSPECIFIED} if not specified.
*/
public @PointFormatEnum int getKemPointFormat() {
return mKemPointFormat;
@@ -184,7 +179,7 @@ public class EcIesParameterSpec implements AlgorithmParameterSpec {
* Builder of {@link EcIesParameterSpec}.
*/
public static class Builder {
- private @PointFormatEnum int mKemPointFormat = PointFormat.UNSPECIFIED;
+ private @PointFormatEnum int mKemPointFormat = POINT_FORMAT_UNSPECIFIED;
private String mKemKdfAlgorithm;
private String mDemCipherTransformation;
private int mDemCipherKeySize = 128;
diff --git a/keystore/java/android/security/KeyStoreKeyProperties.java b/keystore/java/android/security/KeyStoreKeyProperties.java
index d1b0e5b..021c6dd 100644
--- a/keystore/java/android/security/KeyStoreKeyProperties.java
+++ b/keystore/java/android/security/KeyStoreKeyProperties.java
@@ -43,6 +43,9 @@ import javax.crypto.SecretKeyFactory;
public abstract class KeyStoreKeyProperties {
private KeyStoreKeyProperties() {}
+ /**
+ * @hide
+ */
@Retention(RetentionPolicy.SOURCE)
@IntDef(flag = true,
value = {Purpose.ENCRYPT, Purpose.DECRYPT, Purpose.SIGN, Purpose.VERIFY})
@@ -134,6 +137,9 @@ public abstract class KeyStoreKeyProperties {
}
}
+ /**
+ * @hide
+ */
@Retention(RetentionPolicy.SOURCE)
@StringDef({
Algorithm.RSA,
@@ -261,6 +267,9 @@ public abstract class KeyStoreKeyProperties {
}
}
+ /**
+ * @hide
+ */
@Retention(RetentionPolicy.SOURCE)
@StringDef({
BlockMode.ECB,
@@ -356,6 +365,9 @@ public abstract class KeyStoreKeyProperties {
}
}
+ /**
+ * @hide
+ */
@Retention(RetentionPolicy.SOURCE)
@StringDef({
EncryptionPadding.NONE,
@@ -445,6 +457,9 @@ public abstract class KeyStoreKeyProperties {
}
}
+ /**
+ * @hide
+ */
@Retention(RetentionPolicy.SOURCE)
@StringDef({
SignaturePadding.RSA_PKCS1,
@@ -514,6 +529,9 @@ public abstract class KeyStoreKeyProperties {
}
}
+ /**
+ * @hide
+ */
@Retention(RetentionPolicy.SOURCE)
@StringDef({
Digest.NONE,
@@ -652,6 +670,9 @@ public abstract class KeyStoreKeyProperties {
}
}
+ /**
+ * @hide
+ */
@Retention(RetentionPolicy.SOURCE)
@IntDef({Origin.GENERATED, Origin.IMPORTED, Origin.UNKNOWN})
public @interface OriginEnum {}