Home
last modified time | relevance | path

Searched refs:cipher (Results 1 – 8 of 8) sorted by relevance

/cts/tests/tests/keystore/src/android/keystore/cts/
DRSACipherTest.java59 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 …]
DCipherTest.java333 Cipher cipher = Cipher.getInstance(algorithm, provider); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting() local
334 cipher.init(Cipher.ENCRYPT_MODE, key.getKeystoreBackedEncryptionKey()); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
335 AlgorithmParameters params = cipher.getParameters(); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
338 cipher = Cipher.getInstance(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
340 cipher.init(Cipher.DECRYPT_MODE, decryptionKey, params); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
341 assertSame(provider, cipher.getProvider()); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
344 cipher = Cipher.getInstance(algorithm); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
346 cipher.init(Cipher.UNWRAP_MODE, decryptionKey, params); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
348 cipher.init(Cipher.UNWRAP_MODE, decryptionKey); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
350 assertSame(provider, cipher.getProvider()); in testAndroidKeyStoreKeysHandledByAndroidKeyStoreProviderWhenDecrypting()
[all …]
DAESCipherNistCavpKatTest.java284 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()
DImportWrappedKeyTest.java260 Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); in wrapKey() local
263 cipher.init(Cipher.ENCRYPT_MODE, secretKeySpec, gcmParameterSpec); in wrapKey()
266 cipher.updateAAD(aad); in wrapKey()
267 byte[] encryptedSecureKey = cipher.doFinal(keyMaterial); in wrapKey()
DAndroidKeyStoreTest.java1957 String cipher = privateKey.getAlgorithm() + "/NONE/NOPADDING"; in testKeyStore_Encrypting_RSA_NONE_NOPADDING() local
1958 Cipher encrypt = Cipher.getInstance(cipher); in testKeyStore_Encrypting_RSA_NONE_NOPADDING()
2306 Cipher cipher = Cipher.getInstance("AES/GCM/NoPadding"); in testKeyStore_LargeNumberOfKeysSupported_AES() local
2307 cipher.init(Cipher.ENCRYPT_MODE, keystoreKey1); in testKeyStore_LargeNumberOfKeysSupported_AES()
2308 byte[] ciphertext = cipher.doFinal(plaintext); in testKeyStore_LargeNumberOfKeysSupported_AES()
2309 AlgorithmParameters cipherParams = cipher.getParameters(); in testKeyStore_LargeNumberOfKeysSupported_AES()
2310 cipher = Cipher.getInstance(cipher.getAlgorithm()); in testKeyStore_LargeNumberOfKeysSupported_AES()
2311 cipher.init(Cipher.DECRYPT_MODE, key1, cipherParams); in testKeyStore_LargeNumberOfKeysSupported_AES()
2312 MoreAsserts.assertEquals(plaintext, cipher.doFinal(ciphertext)); in testKeyStore_LargeNumberOfKeysSupported_AES()
2314 cipher = Cipher.getInstance(cipher.getAlgorithm()); in testKeyStore_LargeNumberOfKeysSupported_AES()
[all …]
/cts/apps/CtsVerifier/src/com/android/cts/verifier/managedprovisioning/
DAuthenticationBoundKeyTestActivity.java255 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/
DScreenLockBoundKeysTest.java147 Cipher cipher = Cipher.getInstance( in tryEncrypt() local
153 cipher.init(Cipher.ENCRYPT_MODE, secretKey); in tryEncrypt()
154 cipher.doFinal(SECRET_BYTE_ARRAY); in tryEncrypt()
/cts/tests/tests/accounts/src/android/accounts/cts/
DAccountManagerTest.java3440 byte[] cipher = new byte[] {
3445 sessionBundle.putByteArray(KEY_CIPHER, cipher);