summaryrefslogtreecommitdiff
path: root/identity/java
diff options
context:
space:
mode:
authorEran Messeri <eranm@google.com>2020-12-12 19:18:45 +0000
committerEran Messeri <eranm@google.com>2021-01-11 20:46:44 +0000
commita844c5988f1a686db9700cb72502988b2e879c2c (patch)
tree0f125b338abc67df992a168bad3d986b2d8e1926 /identity/java
parent3d91609e47d43f8796b1f4989cdfe5081ba23e4b (diff)
Implement Enrollment-Specific ID
Implement Enrollment-Specific ID, which is calculated using fixed device identifiers, as well as the provisioning package and the Organization Identifier set by the Device Policy Controller. Test: atest FrameworksServicesTests:EnterpriseSpecificIdCalculatorTest Test: atest com.android.cts.devicepolicy.MixedDeviceOwnerTest#testEnrollmentSpecificIdCorrectCalculation com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testEnrollmentSpecificIdCorrectCalculation com.android.cts.devicepolicy.MixedDeviceOwnerTest#testEnrollmentSpecificIdEmptyAndMultipleSet com.android.cts.devicepolicy.MixedManagedProfileOwnerTest#testEnrollmentSpecificIdEmptyAndMultipleSet Bug: 168627890 Change-Id: I8b24efa6b8c82d6181f2b20bc8880ddeb6caa4c5
Diffstat (limited to 'identity/java')
-rw-r--r--identity/java/android/security/identity/Util.java13
1 files changed, 10 insertions, 3 deletions
diff --git a/identity/java/android/security/identity/Util.java b/identity/java/android/security/identity/Util.java
index 6eefeb8f3f2a..e56bd5167906 100644
--- a/identity/java/android/security/identity/Util.java
+++ b/identity/java/android/security/identity/Util.java
@@ -16,6 +16,8 @@
package android.security.identity;
+import android.annotation.NonNull;
+
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.security.InvalidKeyException;
@@ -28,7 +30,10 @@ import java.util.Collection;
import javax.crypto.Mac;
import javax.crypto.spec.SecretKeySpec;
-class Util {
+/**
+ * @hide
+ */
+public class Util {
private static final String TAG = "Util";
static int[] integerCollectionToArray(Collection<Integer> collection) {
@@ -91,8 +96,9 @@ class Util {
* 255.DigestSize, where DigestSize is the size of the underlying HMAC.
* @return size pseudorandom bytes.
*/
- static byte[] computeHkdf(
- String macAlgorithm, final byte[] ikm, final byte[] salt, final byte[] info, int size) {
+ @NonNull public static byte[] computeHkdf(
+ @NonNull String macAlgorithm, @NonNull final byte[] ikm, @NonNull final byte[] salt,
+ @NonNull final byte[] info, int size) {
Mac mac = null;
try {
mac = Mac.getInstance(macAlgorithm);
@@ -137,4 +143,5 @@ class Util {
}
}
+ private Util() {}
}