Home
last modified time | relevance | path

Searched refs:SecretKey (Results 1 – 25 of 56) sorted by relevance

123

/frameworks/base/services/tests/servicestests/src/com/android/server/locksettings/recoverablekeystore/
DWrappedKeyTest.java42 import javax.crypto.SecretKey;
72 SecretKey rawKey = generateKey(); in fromSecretKey_createsWrappedKeyThatCanBeUnwrapped_nullMetadata()
81 SecretKey unwrappedKey = (SecretKey) cipher.unwrap( in fromSecretKey_createsWrappedKeyThatCanBeUnwrapped_nullMetadata()
91 SecretKey rawKey = generateKey(); in fromSecretKey_createsWrappedKeyThatCanBeUnwrapped_nonNullMetadata()
100 SecretKey unwrappedKey = (SecretKey) cipher.unwrap( in fromSecretKey_createsWrappedKeyThatCanBeUnwrapped_nonNullMetadata()
109 SecretKey rawKey = generateKey(); in fromSecretKey_returnsAKeyWithTheGenerationIdOfTheWrappingKey()
119 SecretKey platformKey = generateAndroidKeyStoreKey(); in decryptWrappedKeys_decryptsWrappedKeys_nullMetadata()
120 SecretKey appKey = generateKey(); in decryptWrappedKeys_decryptsWrappedKeys_nullMetadata()
126 Map<String, Pair<SecretKey, byte[]>> unwrappedKeys = WrappedKey.unwrapKeys( in decryptWrappedKeys_decryptsWrappedKeys_nullMetadata()
138 SecretKey platformKey = generateAndroidKeyStoreKey(); in decryptWrappedKeys_decryptsWrappedKeys_nonNullMetadata()
[all …]
DTestOnlyInsecureCertificateHelperTest.java19 import javax.crypto.SecretKey;
68 Map<String, Pair<SecretKey, byte[]>> rawKeys = new HashMap<>(); in testKeepOnlyWhitelistedInsecureKeys_emptyKeysList()
69 Map<String, Pair<SecretKey, byte[]>> expectedResult = new HashMap<>(); in testKeepOnlyWhitelistedInsecureKeys_emptyKeysList()
71 Map<String, Pair<SecretKey, byte[]>> filteredKeys = in testKeepOnlyWhitelistedInsecureKeys_emptyKeysList()
79 Map<String, Pair<SecretKey, byte[]>> rawKeys = new HashMap<>(); in testKeepOnlyWhitelistedInsecureKeys_singleNonWhitelistedKey()
80 Map<String, Pair<SecretKey, byte[]>> expectedResult = new HashMap<>(); in testKeepOnlyWhitelistedInsecureKeys_singleNonWhitelistedKey()
85 Map<String, Pair<SecretKey, byte[]>> filteredKeys = in testKeepOnlyWhitelistedInsecureKeys_singleNonWhitelistedKey()
93 Map<String, Pair<SecretKey, byte[]>> rawKeys = new HashMap<>(); in testKeepOnlyWhitelistedInsecureKeys_singleWhitelistedKey()
94 Map<String, Pair<SecretKey, byte[]>> expectedResult = new HashMap<>(); in testKeepOnlyWhitelistedInsecureKeys_singleWhitelistedKey()
100 Map<String, Pair<SecretKey, byte[]>> filteredKeys = in testKeepOnlyWhitelistedInsecureKeys_singleWhitelistedKey()
[all …]
DKeySyncUtilsTest.java50 import javax.crypto.SecretKey;
94 SecretKey key = KeySyncUtils.generateRecoveryKey(); in generateRecoveryKey_returnsA256BitKey()
101 SecretKey a = KeySyncUtils.generateRecoveryKey(); in generateRecoveryKey_generatesANewKeyEachTime()
102 SecretKey b = KeySyncUtils.generateRecoveryKey(); in generateRecoveryKey_generatesANewKeyEachTime()
125 SecretKey recoveryKey = KeySyncUtils.generateRecoveryKey(); in decryptApplicationKey_decryptsAnApplicationKey_nullMetadata()
126 SecretKey applicationKey = generateApplicationKey(); in decryptApplicationKey_decryptsAnApplicationKey_nullMetadata()
142 SecretKey recoveryKey = KeySyncUtils.generateRecoveryKey(); in decryptApplicationKey_decryptsAnApplicationKey_nonNullMetadata()
143 SecretKey applicationKey = generateApplicationKey(); in decryptApplicationKey_decryptsAnApplicationKey_nonNullMetadata()
180 SecretKey recoveryKey = KeySyncUtils.generateRecoveryKey(); in decryptApplicationKey_throwsIfWrongMetadata()
218 SecretKey recoveryKey = KeySyncUtils.generateRecoveryKey(); in decryptRecoveryKey_decryptsALocallyEncryptedKey()
[all …]
/frameworks/base/services/core/java/com/android/server/locksettings/
DRebootEscrowKey.java24 import javax.crypto.SecretKey;
38 private final SecretKey mKey;
40 private RebootEscrowKey(SecretKey key) { in RebootEscrowKey()
49 final SecretKey secretKey; in generate()
60 SecretKey getKey() { in getKey()
DRebootEscrowKeyStoreManager.java32 import javax.crypto.SecretKey;
64 private SecretKey getKeyStoreEncryptionKeyLocked() { in getKeyStoreEncryptionKeyLocked()
71 return (SecretKey) keyStore.getKey(REBOOT_ESCROW_KEY_STORE_ENCRYPTION_KEY_NAME, in getKeyStoreEncryptionKeyLocked()
79 protected SecretKey getKeyStoreEncryptionKey() { in getKeyStoreEncryptionKey()
100 protected SecretKey generateKeyStoreEncryptionKeyIfNeeded() { in generateKeyStoreEncryptionKeyIfNeeded()
102 SecretKey kk = getKeyStoreEncryptionKeyLocked(); in generateKeyStoreEncryptionKeyIfNeeded()
DRebootEscrowProviderInterface.java25 import javax.crypto.SecretKey;
60 RebootEscrowKey getAndClearRebootEscrowKey(SecretKey decryptionKey) throws IOException; in getAndClearRebootEscrowKey()
70 boolean storeRebootEscrowKey(RebootEscrowKey escrowKey, SecretKey encryptionKey); in storeRebootEscrowKey()
DRebootEscrowData.java26 import javax.crypto.SecretKey;
73 private static byte[] decryptBlobCurrentVersion(SecretKey kk, RebootEscrowKey ks, in decryptBlobCurrentVersion()
86 static RebootEscrowData fromEncryptedData(RebootEscrowKey ks, byte[] blob, SecretKey kk) in fromEncryptedData()
110 byte[] syntheticPassword, SecretKey kk) in fromSyntheticPassword()
DAesEncryptionUtil.java33 import javax.crypto.SecretKey;
42 static byte[] decrypt(SecretKey key, DataInputStream cipherStream) throws IOException { in decrypt()
75 static byte[] decrypt(SecretKey key, byte[] cipherText) throws IOException { in decrypt()
83 static byte[] encrypt(SecretKey key, byte[] plainText) throws IOException { in encrypt()
DSyntheticPasswordCrypto.java48 import javax.crypto.SecretKey;
63 private static byte[] decrypt(SecretKey key, byte[] blob) in decrypt()
77 private static byte[] encrypt(SecretKey key, byte[] blob) in encrypt()
137 SecretKey protectorKey = (SecretKey) keyStore.getKey(protectorKeyAlias, null); in decryptBlobV1()
173 SecretKey protectorKey = (SecretKey) keyStore.getKey(protectorKeyAlias, null); in decryptBlob()
206 SecretKey protectorKey = keyGenerator.generateKey(); in createBlob()
DRebootEscrowProviderServerBasedImpl.java31 import javax.crypto.SecretKey;
107 private byte[] unwrapServerBlob(byte[] serverBlob, SecretKey decryptionKey) throws in unwrapServerBlob()
134 public RebootEscrowKey getAndClearRebootEscrowKey(SecretKey decryptionKey) throws IOException { in getAndClearRebootEscrowKey()
174 private byte[] wrapEscrowKey(byte[] escrowKeyBytes, SecretKey encryptionKey) throws in wrapEscrowKey()
199 public boolean storeRebootEscrowKey(RebootEscrowKey escrowKey, SecretKey encryptionKey) { in storeRebootEscrowKey()
DRebootEscrowProviderHalImpl.java30 import javax.crypto.SecretKey;
73 public RebootEscrowKey getAndClearRebootEscrowKey(SecretKey decryptionKey) { in getAndClearRebootEscrowKey()
130 public boolean storeRebootEscrowKey(RebootEscrowKey escrowKey, SecretKey encryptionKey) { in storeRebootEscrowKey()
/frameworks/base/services/core/java/com/android/server/locksettings/recoverablekeystore/
DPlatformEncryptionKey.java19 import javax.crypto.SecretKey;
36 private final SecretKey mKey;
44 public PlatformEncryptionKey(int generationId, SecretKey key) { in PlatformEncryptionKey()
59 public SecretKey getKey() { in getKey()
DPlatformDecryptionKey.java19 import javax.crypto.SecretKey;
33 private final SecretKey mKey;
43 public PlatformDecryptionKey(int generationId, SecretKey key) { in PlatformDecryptionKey()
62 public SecretKey getKey() { in getKey()
DWrappedKey.java35 import javax.crypto.SecretKey;
64 public static WrappedKey fromSecretKey(PlatformEncryptionKey wrappingKey, SecretKey key, in fromSecretKey()
200 public static Map<String, Pair<SecretKey, byte[]>> unwrapKeys( in unwrapKeys()
205 HashMap<String, Pair<SecretKey, byte[]>> unwrappedKeys = new HashMap<>(); in unwrapKeys()
225 SecretKey key; in unwrapKeys()
227 key = (SecretKey) cipher.unwrap( in unwrapKeys()
DKeySyncUtils.java42 import javax.crypto.SecretKey;
89 SecretKey recoveryKey in thmEncryptRecoveryKey()
128 static byte[] locallyEncryptRecoveryKey(byte[] lockScreenHash, SecretKey recoveryKey) in locallyEncryptRecoveryKey()
142 public static SecretKey generateRecoveryKey() throws NoSuchAlgorithmException { in generateRecoveryKey()
160 SecretKey recoveryKey, Map<String, Pair<SecretKey, byte[]>> keys) in encryptKeysWithRecoveryKey() argument
164 SecretKey key = keys.get(alias).first; in encryptKeysWithRecoveryKey()
DTestOnlyInsecureCertificateHelper.java36 import javax.crypto.SecretKey;
130 public Map<String, Pair<SecretKey, byte[]>> keepOnlyWhitelistedInsecureKeys( in keepOnlyWhitelistedInsecureKeys() argument
131 Map<String, Pair<SecretKey, byte[]>> rawKeys) { in keepOnlyWhitelistedInsecureKeys()
135 Map<String, Pair<SecretKey, byte[]>> filteredKeys = new HashMap<>(); in keepOnlyWhitelistedInsecureKeys()
136 for (Map.Entry<String, Pair<SecretKey, byte[]>> entry : rawKeys.entrySet()) { in keepOnlyWhitelistedInsecureKeys()
DPlatformKeyManager.java46 import javax.crypto.SecretKey;
239 SecretKey key = (SecretKey) mKeyStore.getKey( in getEncryptKeyInternal()
291 SecretKey key = (SecretKey) mKeyStore.getKey( in getDecryptKeyInternal()
425 SecretKey secretKey = generateAesKey(); in generateAndLoadKey()
468 private static SecretKey generateAesKey() throws NoSuchAlgorithmException { in generateAesKey()
DRecoverableKeyGenerator.java31 import javax.crypto.SecretKey;
102 SecretKey key = mKeyGenerator.generateKey(); in generateAndStoreKey()
146 SecretKey key = new SecretKeySpec(keyBytes, SECRET_KEY_ALGORITHM); in importKey()
/frameworks/base/services/backup/java/com/android/server/backup/utils/
DPasswordUtils.java30 import javax.crypto.SecretKey;
53 public static SecretKey buildPasswordKey(String algorithm, String pw, byte[] salt, int rounds) { in buildPasswordKey()
68 SecretKey key = buildPasswordKey(algorithm, pw, salt, rounds); in buildPasswordHash()
120 private static SecretKey buildCharArrayKey(String algorithm, char[] pwArray, byte[] salt, in buildCharArrayKey()
/frameworks/base/keystore/java/android/security/keystore2/
DAndroidKeyStoreSecretKey.java24 import javax.crypto.SecretKey;
31 public class AndroidKeyStoreSecretKey extends AndroidKeyStoreKey implements SecretKey {
DAndroidKeyStoreSecretKeyFactorySpi.java37 import javax.crypto.SecretKey;
49 protected KeySpec engineGetKeySpec(SecretKey key, in engineGetKeySpec()
278 protected SecretKey engineGenerateSecret(KeySpec keySpec) throws InvalidKeySpecException { in engineGenerateSecret()
285 protected SecretKey engineTranslateKey(SecretKey key) throws InvalidKeyException { in engineTranslateKey()
/frameworks/base/services/companion/java/com/android/server/companion/transport/
DCryptoManager.java31 import javax.crypto.SecretKey;
49 private SecretKey mSecretKey;
109 private SecretKey getKey() { in getKey()
/frameworks/base/libs/securebox/src/com/android/security/
DSecureBox.java54 import javax.crypto.SecretKey;
207 SecretKey encryptionKey = hkdfDeriveKey(keyingMaterial, HKDF_SALT, hkdfInfo); in encrypt()
276 SecretKey decryptionKey = hkdfDeriveKey(keyingMaterial, HKDF_SALT, hkdfInfo); in decrypt()
305 private static SecretKey hkdfDeriveKey(byte[] secret, byte[] salt, byte[] info) in hkdfDeriveKey()
329 private static byte[] aesGcmEncrypt(SecretKey key, byte[] nonce, byte[] plaintext, byte[] aad) in aesGcmEncrypt()
339 private static byte[] aesGcmDecrypt(SecretKey key, byte[] nonce, byte[] ciphertext, byte[] aad) in aesGcmDecrypt()
345 AesGcmOperation operation, SecretKey key, byte[] nonce, byte[] text, byte[] aad) in aesGcmInternal()
/frameworks/base/apct-tests/perftests/core/src/android/libcore/regression/
DCipherPerfTest.java40 import javax.crypto.SecretKey;
129 private static Map<Integer, SecretKey> sKeySizes = new HashMap<Integer, SecretKey>();
132 private SecretKey mKey;
/frameworks/base/services/core/java/com/android/server/accounts/
DCryptoHelper.java18 import javax.crypto.SecretKey;
38 private final SecretKey mEncryptionKey;
39 private final SecretKey mMacKey;

123