/cts/tests/tests/keystore/src/android/keystore/cts/ |
D | RSACipherTest.java | 93 Cipher cipher = Cipher.getInstance("RSA/ECB/NoPadding", provider); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus() local 94 cipher.init(Cipher.ENCRYPT_MODE, publicKey); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus() 95 assertArrayEquals(expectedOutput, cipher.doFinal(input)); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus() 97 cipher.init(Cipher.DECRYPT_MODE, privateKey); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus() 98 assertArrayEquals(expectedOutput, cipher.doFinal(input)); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus() 124 Cipher cipher = Cipher.getInstance("RSA/ECB/NoPadding", provider); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus() local 125 cipher.init(Cipher.ENCRYPT_MODE, publicKey); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus() 126 byte[] ciphertext = cipher.doFinal(plaintext); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus() 127 cipher.init(Cipher.DECRYPT_MODE, privateKey); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus() 128 assertArrayEquals(plaintext, cipher.doFinal(ciphertext)); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus() [all …]
|
D | CipherTest.java | 394 Cipher cipher = Cipher.getInstance(algorithm, provider); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() local 395 cipher.init(Cipher.ENCRYPT_MODE, key.getKeystoreBackedEncryptionKey()); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 396 AlgorithmParameters params = cipher.getParameters(); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 399 cipher = Cipher.getInstance(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 401 cipher.init(Cipher.DECRYPT_MODE, decryptionKey, params); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 402 assertSame(provider, cipher.getProvider()); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 405 cipher = Cipher.getInstance(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 407 cipher.init(Cipher.UNWRAP_MODE, decryptionKey, params); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 409 cipher.init(Cipher.UNWRAP_MODE, decryptionKey); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 411 assertSame(provider, cipher.getProvider()); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() [all …]
|
D | AESCipherNistCavpKatTest.java | 322 Cipher cipher = Cipher.getInstance("AES/" + mode + "/NoPadding"); in runKatTest() local 326 cipher.init(opmode, key, new IvParameterSpec(testVector.iv)); in runKatTest() 328 cipher.init(opmode, key); in runKatTest() 332 byte[] actualOutput = cipher.doFinal(input); in runKatTest()
|
D | AndroidKeyStoreTest.java | 1877 Cipher cipher = Cipher.getInstance(algorithm); in testKeyStore_SetKeyEntry_ReplacedWithSameGeneratedSecretKey() local 1878 cipher.init(Cipher.ENCRYPT_MODE, key); in testKeyStore_SetKeyEntry_ReplacedWithSameGeneratedSecretKey() 1879 AlgorithmParameters params = cipher.getParameters(); in testKeyStore_SetKeyEntry_ReplacedWithSameGeneratedSecretKey() 1880 final byte[] ciphertext = cipher.doFinal(plaintext.getBytes()); in testKeyStore_SetKeyEntry_ReplacedWithSameGeneratedSecretKey() 1889 cipher = Cipher.getInstance(algorithm); in testKeyStore_SetKeyEntry_ReplacedWithSameGeneratedSecretKey() 1890 cipher.init(Cipher.DECRYPT_MODE, key2, params); in testKeyStore_SetKeyEntry_ReplacedWithSameGeneratedSecretKey() 1891 byte[] plaintext2 = cipher.doFinal(ciphertext); in testKeyStore_SetKeyEntry_ReplacedWithSameGeneratedSecretKey() 2043 String cipher = privateKey.getAlgorithm() + "/NONE/NOPADDING"; in testKeyStore_Encrypting_RSA_NONE_NOPADDING() local 2044 Cipher encrypt = Cipher.getInstance(cipher); in testKeyStore_Encrypting_RSA_NONE_NOPADDING() 2352 Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); in testKeyStore_LargeNumberOfKeysSupported_AES() local [all …]
|
D | KeyGeneratorTest.java | 843 Cipher cipher = Cipher.getInstance(algoTransform, in assertUniqueAesEncryptionForNKeys() local 846 cipher.init(Cipher.ENCRYPT_MODE, key, new IvParameterSpec(iv)); in assertUniqueAesEncryptionForNKeys() 848 cipher.init(Cipher.ENCRYPT_MODE, key); in assertUniqueAesEncryptionForNKeys() 850 byte[] cipherText = msg == null ? cipher.doFinal() : cipher.doFinal(msg); in assertUniqueAesEncryptionForNKeys()
|
D | ImportWrappedKeyTest.java | 502 Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); in wrapKey() local 505 cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, gcmParameterSpec); in wrapKey() 508 cipher.updateAAD(aad); in wrapKey() 509 byte[] encryptedSecureKey = cipher.doFinal(keyMaterial); in wrapKey()
|
/cts/apps/CtsVerifier/src/com/android/cts/verifier/biometrics/ |
D | Utils.java | 83 Cipher cipher = Cipher.getInstance(KeyProperties.KEY_ALGORITHM_AES + "/" in initCipher() local 86 cipher.init(Cipher.ENCRYPT_MODE, secretKey); in initCipher() 87 return cipher; in initCipher() 95 Cipher cipher = Cipher.getInstance(KeyProperties.KEY_ALGORITHM_AES + "/" in initAeadCipher() local 98 cipher.init(Cipher.ENCRYPT_MODE, secretKey); in initAeadCipher() 99 return cipher; in initAeadCipher() 145 static byte[] doEncrypt(Cipher cipher, byte[] data) throws Exception { in doEncrypt() argument 146 return cipher.doFinal(data); in doEncrypt()
|
D | CredentialCryptoTests.java | 126 final Cipher cipher = Utils.initCipher(keyName); in testTimedKey() local 150 final Cipher cipher = Utils.initCipher(keyName); in testTimedKey() 151 byte[] encrypted = Utils.doEncrypt(cipher, SECRET_BYTE_ARRAY); in testTimedKey()
|
/cts/tests/tests/identity/src/android/security/identity/cts/ |
D | EphemeralKeyTest.java | 189 Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); in encryptMessageToHolder() local 191 cipher.init(Cipher.ENCRYPT_MODE, mReaderSecretKey, encryptionParameterSpec); in encryptMessageToHolder() 192 messageCiphertext = cipher.doFinal(messagePlaintext); // This includes the auth tag in encryptMessageToHolder() 214 final Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); in decryptMessageFromHolder() local 215 cipher.init(Cipher.DECRYPT_MODE, mSecretKey, new GCMParameterSpec(128, iv.array())); in decryptMessageFromHolder() 216 plaintext = cipher.doFinal(messageCiphertext); in decryptMessageFromHolder()
|
/cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/ |
D | AuthenticationBoundKeyTestActivity.java | 265 Cipher cipher = Cipher.getInstance(CIPHER_TRANSFORMATION); in tryEncryptWithLockscreenKey() local 266 cipher.init(Cipher.ENCRYPT_MODE, loadSecretKey(LOCKSCREEN)); in tryEncryptWithLockscreenKey() 267 cipher.doFinal(SECRET_BYTE_ARRAY); in tryEncryptWithLockscreenKey() 286 Cipher cipher = Cipher.getInstance(CIPHER_TRANSFORMATION); in initFingerprintEncryptionCipher() local 287 cipher.init(Cipher.ENCRYPT_MODE, loadSecretKey(FINGERPRINT)); in initFingerprintEncryptionCipher() 288 return cipher; in initFingerprintEncryptionCipher() 302 private boolean tryEncryptWithFingerprintKey(Cipher cipher) { in tryEncryptWithFingerprintKey() argument 305 cipher.doFinal(SECRET_BYTE_ARRAY); in tryEncryptWithFingerprintKey()
|
/cts/apps/CtsVerifier/src/com/android/cts/verifier/security/ |
D | LskfBoundKeysTest.java | 147 Cipher cipher = Cipher.getInstance( in tryEncrypt() local 153 cipher.init(Cipher.ENCRYPT_MODE, secretKey); in tryEncrypt() 154 cipher.doFinal(SECRET_BYTE_ARRAY); in tryEncrypt()
|
D | UnlockedDeviceRequiredKeysTest.java | 205 Cipher cipher = Cipher.getInstance( in tryEncrypt() local 210 cipher.init(Cipher.ENCRYPT_MODE, secretKey); in tryEncrypt() 211 cipher.doFinal(SECRET_BYTE_ARRAY); in tryEncrypt()
|
/cts/tests/framework/base/biometrics/src/android/server/biometrics/util/ |
D | Utils.java | 270 final Cipher cipher = Cipher.getInstance(KeyProperties.KEY_ALGORITHM_AES + "/" in initializeCryptoObject() local 273 cipher.init(Cipher.ENCRYPT_MODE, secretKey); in initializeCryptoObject() 276 new BiometricPrompt.CryptoObject(cipher); in initializeCryptoObject()
|
/cts/tests/tests/accounts/src/android/accounts/cts/ |
D | AccountManagerTest.java | 3452 byte[] cipher = new byte[] { 3457 sessionBundle.putByteArray(KEY_CIPHER, cipher);
|