/cts/tests/tests/keystore/src/android/keystore/cts/ |
D | RSACipherTest.java | 59 Cipher cipher = Cipher.getInstance("RSA/ECB/NoPadding", provider); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus() local 60 cipher.init(Cipher.ENCRYPT_MODE, publicKey); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus() 61 MoreAsserts.assertEquals(expectedOutput, cipher.doFinal(input)); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus() 63 cipher.init(Cipher.DECRYPT_MODE, privateKey); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus() 64 MoreAsserts.assertEquals(expectedOutput, cipher.doFinal(input)); in testNoPaddingEncryptionAndDecryptionSucceedsWithInputShorterThanModulus() 89 Cipher cipher = Cipher.getInstance("RSA/ECB/NoPadding", provider); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus() local 90 cipher.init(Cipher.ENCRYPT_MODE, publicKey); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus() 91 byte[] ciphertext = cipher.doFinal(plaintext); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus() 92 cipher.init(Cipher.DECRYPT_MODE, privateKey); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus() 93 MoreAsserts.assertEquals(plaintext, cipher.doFinal(ciphertext)); in testNoPaddingEncryptionSucceedsWithPlaintextOneSmallerThanModulus() [all …]
|
D | CipherTest.java | 353 Cipher cipher = Cipher.getInstance(algorithm, provider); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() local 354 cipher.init(Cipher.ENCRYPT_MODE, key.getKeystoreBackedEncryptionKey()); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 355 AlgorithmParameters params = cipher.getParameters(); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 358 cipher = Cipher.getInstance(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 360 cipher.init(Cipher.DECRYPT_MODE, decryptionKey, params); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 361 assertSame(provider, cipher.getProvider()); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 364 cipher = Cipher.getInstance(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 366 cipher.init(Cipher.UNWRAP_MODE, decryptionKey, params); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 368 cipher.init(Cipher.UNWRAP_MODE, decryptionKey); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() 370 assertSame(provider, cipher.getProvider()); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() [all …]
|
D | AESCipherNistCavpKatTest.java | 284 Cipher cipher = Cipher.getInstance("AES/" + mode + "/NoPadding"); in runKatTest() local 288 cipher.init(opmode, key, new IvParameterSpec(testVector.iv)); in runKatTest() 290 cipher.init(opmode, key); in runKatTest() 294 byte[] actualOutput = cipher.doFinal(input); in runKatTest()
|
D | AndroidKeyStoreTest.java | 1918 String cipher = privateKey.getAlgorithm() + "/NONE/NOPADDING"; in testKeyStore_Encrypting_RSA_NONE_NOPADDING() local 1919 Cipher encrypt = Cipher.getInstance(cipher); in testKeyStore_Encrypting_RSA_NONE_NOPADDING() 2212 Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); in testKeyStore_LargeNumberOfKeysSupported_AES() local 2213 cipher.init(Cipher.ENCRYPT_MODE, keystoreKey1); in testKeyStore_LargeNumberOfKeysSupported_AES() 2214 byte[] ciphertext = cipher.doFinal(plaintext); in testKeyStore_LargeNumberOfKeysSupported_AES() 2215 AlgorithmParameters cipherParams = cipher.getParameters(); in testKeyStore_LargeNumberOfKeysSupported_AES() 2216 cipher = Cipher.getInstance(cipher.getAlgorithm()); in testKeyStore_LargeNumberOfKeysSupported_AES() 2217 cipher.init(Cipher.DECRYPT_MODE, key1, cipherParams); in testKeyStore_LargeNumberOfKeysSupported_AES() 2218 MoreAsserts.assertEquals(plaintext, cipher.doFinal(ciphertext)); in testKeyStore_LargeNumberOfKeysSupported_AES() 2220 cipher = Cipher.getInstance(cipher.getAlgorithm()); in testKeyStore_LargeNumberOfKeysSupported_AES() [all …]
|
D | ImportWrappedKeyTest.java | 329 Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); in wrapKey() local 332 cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, gcmParameterSpec); in wrapKey() 335 cipher.updateAAD(aad); in wrapKey() 336 byte[] encryptedSecureKey = cipher.doFinal(keyMaterial); in wrapKey()
|
/cts/apps/CtsVerifier/src/com/android/cts/verifier/biometrics/ |
D | Utils.java | 84 Cipher cipher = Cipher.getInstance(KeyProperties.KEY_ALGORITHM_AES + "/" in initCipher() local 87 cipher.init(Cipher.ENCRYPT_MODE, secretKey); in initCipher() 88 return cipher; in initCipher() 118 static byte[] doEncrypt(Cipher cipher, byte[] data) throws Exception { in doEncrypt() argument 119 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 | 188 Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); in encryptMessageToHolder() local 190 cipher.init(Cipher.ENCRYPT_MODE, mReaderSecretKey, encryptionParameterSpec); in encryptMessageToHolder() 191 messageCiphertext = cipher.doFinal(messagePlaintext); // This includes the auth tag in encryptMessageToHolder() 213 final Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); in decryptMessageFromHolder() local 214 cipher.init(Cipher.DECRYPT_MODE, mSecretKey, new GCMParameterSpec(128, iv.array())); in decryptMessageFromHolder() 215 plaintext = cipher.doFinal(messageCiphertext); in decryptMessageFromHolder()
|
D | UserAuthTest.java | 150 Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); in checkAuthBoundKey() local 151 cipher.init(Cipher.ENCRYPT_MODE, secretKey); in checkAuthBoundKey() 153 byte[] cipherText = cipher.doFinal(clearText); in checkAuthBoundKey()
|
/cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/ |
D | AuthenticationBoundKeyTestActivity.java | 255 Cipher cipher = Cipher.getInstance(CIPHER_TRANSFORMATION); in tryEncryptWithLockscreenKey() local 256 cipher.init(Cipher.ENCRYPT_MODE, loadSecretKey(LOCKSCREEN)); in tryEncryptWithLockscreenKey() 257 cipher.doFinal(SECRET_BYTE_ARRAY); in tryEncryptWithLockscreenKey() 276 Cipher cipher = Cipher.getInstance(CIPHER_TRANSFORMATION); in initFingerprintEncryptionCipher() local 277 cipher.init(Cipher.ENCRYPT_MODE, loadSecretKey(FINGERPRINT)); in initFingerprintEncryptionCipher() 278 return cipher; in initFingerprintEncryptionCipher() 292 private boolean tryEncryptWithFingerprintKey(Cipher cipher) { in tryEncryptWithFingerprintKey() argument 295 cipher.doFinal(SECRET_BYTE_ARRAY); in tryEncryptWithFingerprintKey()
|
/cts/apps/CtsVerifier/src/com/android/cts/verifier/security/ |
D | ScreenLockBoundKeysTest.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 | UnlockedDeviceRequiredTest.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/ |
D | Utils.java | 235 final Cipher cipher = Cipher.getInstance(KeyProperties.KEY_ALGORITHM_AES + "/" in initializeCryptoObject() local 238 cipher.init(Cipher.ENCRYPT_MODE, secretKey); in initializeCryptoObject() 241 new BiometricPrompt.CryptoObject(cipher); in initializeCryptoObject()
|
/cts/tests/tests/accounts/src/android/accounts/cts/ |
D | AccountManagerTest.java | 3438 byte[] cipher = new byte[] { 3443 sessionBundle.putByteArray(KEY_CIPHER, cipher);
|