Home
last modified time | relevance | path

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

/libcore/luni/src/test/java/libcore/javax/crypto/
DCipherInputStreamTest.java110 Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); in testAvailable() local
111 cipher.init(Cipher.DECRYPT_MODE, key, iv); in testAvailable()
113 InputStream cin = new CipherInputStream(in, cipher); in testAvailable()
119 Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); in testDecrypt_NullInput_Discarded() local
120 cipher.init(Cipher.DECRYPT_MODE, key, iv); in testDecrypt_NullInput_Discarded()
121 InputStream in = new CipherInputStream(new ByteArrayInputStream(aesCipherText), cipher); in testDecrypt_NullInput_Discarded()
132 Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); in testEncrypt() local
133 cipher.init(Cipher.ENCRYPT_MODE, key, iv); in testEncrypt()
135 new ByteArrayInputStream(plainText.getBytes("UTF-8")), cipher); in testEncrypt()
144 Cipher cipher = Cipher.getInstance("RC4"); in testEncrypt_RC4() local
[all …]
DCipherOutputStreamTest.java40 Cipher cipher; in testDecryptCorruptGCM() local
42 cipher = Cipher.getInstance("AES/GCM/NoPadding", provider); in testDecryptCorruptGCM()
60 cipher.init(Cipher.ENCRYPT_MODE, key); in testDecryptCorruptGCM()
62 cipher.init(Cipher.ENCRYPT_MODE, key, params); in testDecryptCorruptGCM()
64 byte[] encrypted = cipher.doFinal(unencrypted); in testDecryptCorruptGCM()
69 cipher.init(Cipher.DECRYPT_MODE, key, params); in testDecryptCorruptGCM()
70 CipherOutputStream cos = new CipherOutputStream(new ByteArrayOutputStream(), cipher); in testDecryptCorruptGCM()
DCipherTest.java483 Cipher cipher = Cipher.getInstance("FOO"); in test_init_onKeyTypeChange_reInitCipher() local
484 cipher.init(Cipher.ENCRYPT_MODE, new MockKey()); in test_init_onKeyTypeChange_reInitCipher()
485 assertEquals("MockProvider", cipher.getProvider().getName()); in test_init_onKeyTypeChange_reInitCipher()
487 cipher.init(Cipher.ENCRYPT_MODE, new MockKey2()); in test_init_onKeyTypeChange_reInitCipher()
489 assertEquals("MockProvider2", cipher.getProvider().getName()); in test_init_onKeyTypeChange_reInitCipher()
517 Cipher cipher = Cipher.getInstance("FOO"); in test_init_onAlgorithmParameterTypeChange_reInitCipher() local
518 cipher.init(Cipher.ENCRYPT_MODE, in test_init_onAlgorithmParameterTypeChange_reInitCipher()
521 assertEquals("MockProvider", cipher.getProvider().getName()); in test_init_onAlgorithmParameterTypeChange_reInitCipher()
523 cipher.init(Cipher.ENCRYPT_MODE, in test_init_onAlgorithmParameterTypeChange_reInitCipher()
527 assertEquals("MockProvider2", cipher.getProvider().getName()); in test_init_onAlgorithmParameterTypeChange_reInitCipher()
[all …]
/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/
DSealedObjectTest.java109 Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding"); in testSealedObject1() local
110 cipher.init(Cipher.ENCRYPT_MODE, key, ips); in testSealedObject1()
112 SealedObject so = new SealedObject(secret, cipher); in testSealedObject1()
114 cipher = Cipher.getInstance("DES/CBC/NoPadding"); in testSealedObject1()
115 cipher.init(Cipher.ENCRYPT_MODE, key, ips); in testSealedObject1()
118 new SealedObject(secret, cipher); in testSealedObject1()
138 Cipher cipher = new NullCipher(); in testSealedObject2() local
139 SealedObject so1 = new SealedObject(secret, cipher); in testSealedObject2()
144 .getObject(cipher)); in testSealedObject2()
160 Cipher cipher = Cipher.getInstance(algorithm); in testGetAlgorithm() local
[all …]
DCipherTest.java92 Cipher cipher = Cipher.getInstance("DESede/CBC/PKCS5Padding"); in test_getInstanceLjava_lang_String() local
93 assertNotNull("Received a null Cipher instance", cipher); in test_getInstanceLjava_lang_String()
114 Cipher cipher = Cipher.getInstance("DES", providers[i].getName()); in test_getInstanceLjava_lang_StringLjava_lang_String() local
115 assertNotNull("Cipher.getInstance() returned a null value", cipher); in test_getInstanceLjava_lang_StringLjava_lang_String()
118 cipher = Cipher.getInstance("DoBeDoBeDo", providers[i]); in test_getInstanceLjava_lang_StringLjava_lang_String()
148 Cipher cipher = Cipher.getInstance("DES", providers[i]); in test_getInstanceLjava_lang_StringLjava_security_Provider() local
149 assertNotNull("Cipher.getInstance() returned a null value", cipher); in test_getInstanceLjava_lang_StringLjava_security_Provider()
176 Cipher cipher = Cipher.getInstance("AES", provider.getName()); in test_getProvider() local
177 Provider cipherProvider = cipher.getProvider(); in test_getProvider()
190 Cipher cipher = Cipher.getInstance(algorithm); in test_getAlgorithm() local
[all …]
/libcore/ojluni/src/main/java/javax/crypto/
DCipherOutputStream.java66 private Cipher cipher; field in CipherOutputStream
94 cipher = c; in CipherOutputStream()
109 cipher = new NullCipher(); in CipherOutputStream()
121 obuffer = cipher.update(ibuffer, 0, 1); in write()
158 obuffer = cipher.update(b, off, len); in write()
210 obuffer = cipher.doFinal(); in close()
DCipherInputStream.java73 private Cipher cipher; field in CipherInputStream
119 int expectedOutputSize = cipher.getOutputSize(ibuffer.length); in getMoreData()
130 ofinish = cipher.doFinal(obuffer, 0); in getMoreData()
141 ofinish = cipher.update(ibuffer, 0, readin, obuffer, 0); in getMoreData()
166 cipher = c; in CipherInputStream()
180 cipher = new NullCipher(); in CipherInputStream()
331 cipher.doFinal(); in close()
DEncryptedPrivateKeyInfo.java246 public PKCS8EncodedKeySpec getKeySpec(Cipher cipher) in getKeySpec() argument
250 encoded = cipher.doFinal(encryptedData); in getKeySpec()
/libcore/ojluni/src/main/java/java/security/
DSignature.java1479 private final Cipher cipher; field in Signature.CipherAdapter
1483 CipherAdapter(Cipher cipher) { in CipherAdapter() argument
1484 this.cipher = cipher; in CipherAdapter()
1489 cipher.init(Cipher.DECRYPT_MODE, publicKey); in engineInitVerify()
1499 cipher.init(Cipher.ENCRYPT_MODE, privateKey); in engineInitSign()
1505 cipher.init(Cipher.ENCRYPT_MODE, privateKey, random); in engineInitSign()
1519 byte[] out = cipher.update(b, off, len); in engineUpdate()
1528 return cipher.doFinal(); in engineSign()
1539 byte[] out = cipher.doFinal(sigBytes); in engineVerify()
/libcore/ojluni/annotations/hiddenapi/java/security/
DSignature.java202 CipherAdapter(javax.crypto.Cipher cipher) { in CipherAdapter() argument
249 private final javax.crypto.Cipher cipher; field in Signature.CipherAdapter
252 cipher = null;