Home
last modified time | relevance | path

Searched refs:Cipher (Results 1 – 25 of 30) sorted by relevance

12

/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/
DCipherTest.java42 import javax.crypto.Cipher;
92 Cipher cipher = Cipher.getInstance("DESede/CBC/PKCS5Padding"); in test_getInstanceLjava_lang_String()
96 Cipher.getInstance("WrongAlgorithmName"); in test_getInstanceLjava_lang_String()
114 Cipher cipher = Cipher.getInstance("DES", providers[i].getName()); in test_getInstanceLjava_lang_StringLjava_lang_String()
118 cipher = Cipher.getInstance("DoBeDoBeDo", providers[i]); in test_getInstanceLjava_lang_StringLjava_lang_String()
125 Cipher.getInstance("DES", (String) null); in test_getInstanceLjava_lang_StringLjava_lang_String()
131 Cipher.getInstance("DES", "IHaveNotBeenConfigured"); in test_getInstanceLjava_lang_StringLjava_lang_String()
148 Cipher cipher = Cipher.getInstance("DES", providers[i]); in test_getInstanceLjava_lang_StringLjava_security_Provider()
153 Cipher.getInstance("DES", (Provider) null); in test_getInstanceLjava_lang_StringLjava_security_Provider()
159 Cipher.getInstance("WrongAlg", providers[0]); in test_getInstanceLjava_lang_StringLjava_security_Provider()
[all …]
DSealedObjectTest.java39 import javax.crypto.Cipher;
53 public Mock_SealedObject(Serializable object, Cipher c) in Mock_SealedObject()
109 Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding"); in testSealedObject1()
110 cipher.init(Cipher.ENCRYPT_MODE, key, ips); in testSealedObject1()
114 cipher = Cipher.getInstance("DES/CBC/NoPadding"); in testSealedObject1()
115 cipher.init(Cipher.ENCRYPT_MODE, key, ips); in testSealedObject1()
138 Cipher cipher = new NullCipher(); in testSealedObject2()
160 Cipher cipher = Cipher.getInstance(algorithm); in testGetAlgorithm()
161 cipher.init(Cipher.ENCRYPT_MODE, key); in testGetAlgorithm()
175 Cipher cipher = Cipher.getInstance(algorithm); in testGetAlgorithmAfterSerialization()
[all …]
DCipherOutputStreamTest.java21 import javax.crypto.Cipher;
32 new CipherOutputStream((OutputStream) null, Cipher in test_close()
41 new CipherOutputStream(ch, Cipher in test_close()
DCipherInputStreamTest.java26 import javax.crypto.Cipher;
53 Cipher.getInstance("DES/CBC/PKCS5Padding")).close(); in testClose()
60 Cipher.getInstance("DES/CBC/PKCS5Padding")).close(); in testClose()
DCipherOutputStream1Test.java39 import javax.crypto.Cipher;
150 Cipher cf = Cipher.getInstance("DES/CBC/PKCS5Padding"); in testWrite5()
201 Cipher c = Cipher.getInstance("DES/CBC/NoPadding"); in test_ConstructorLjava_io_OutputStreamLjavax_crypto_Cipher()
202 c.init(Cipher.ENCRYPT_MODE, key); in test_ConstructorLjava_io_OutputStreamLjavax_crypto_Cipher()
DNullCipherTest.java28 import javax.crypto.Cipher;
41 private Cipher c;
76 c.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(new byte[1], "algorithm")); in testInitintKey()
84 c.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(new byte[1], in testInitintKeySecureRandom()
93 c.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(new byte[1], in testInitintKeyAlgorithmParameterSpec()
DCipherInputStream1Test.java31 import javax.crypto.Cipher;
259 Cipher c = Cipher.getInstance("DES/CBC/NoPadding"); in test_ConstructorLjava_io_InputStreamLjavax_crypto_Cipher()
260 c.init(Cipher.ENCRYPT_MODE, key); in test_ConstructorLjava_io_InputStreamLjavax_crypto_Cipher()
/libcore/luni/src/test/java/libcore/javax/crypto/
DCipherTest.java49 import javax.crypto.Cipher;
134 return Cipher.WRAP_MODE; in getEncryptMode()
136 return Cipher.ENCRYPT_MODE; in getEncryptMode()
141 return Cipher.UNWRAP_MODE; in getDecryptMode()
143 return Cipher.DECRYPT_MODE; in getDecryptMode()
365 setExpectedBlockSize("RSA", Cipher.ENCRYPT_MODE, 256);
366 setExpectedBlockSize("RSA/ECB/NoPadding", Cipher.ENCRYPT_MODE, 256);
367 setExpectedBlockSize("RSA/ECB/PKCS1Padding", Cipher.ENCRYPT_MODE, 245);
370 setExpectedBlockSize("RSA", Cipher.ENCRYPT_MODE, "BC", 255);
371 setExpectedBlockSize("RSA/ECB/NoPadding", Cipher.ENCRYPT_MODE, "BC", 255);
[all …]
DCipherInputStreamTest.java26 import javax.crypto.Cipher;
97 Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); in testAvailable()
98 cipher.init(Cipher.DECRYPT_MODE, key, iv); in testAvailable()
106 Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); in testDecrypt_NullInput_Discarded()
107 cipher.init(Cipher.DECRYPT_MODE, key, iv); in testDecrypt_NullInput_Discarded()
119 Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); in testEncrypt()
120 cipher.init(Cipher.ENCRYPT_MODE, key, iv); in testEncrypt()
131 Cipher cipher = Cipher.getInstance("RC4"); in testEncrypt_RC4()
132 cipher.init(Cipher.ENCRYPT_MODE, rc4Key); in testEncrypt_RC4()
143 Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding"); in testDecrypt()
[all …]
/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/func/
DCipherWrapThread.java22 import javax.crypto.Cipher;
37 Cipher cip = Cipher.getInstance(getAlgName()); in crypt()
39 cip.init(Cipher.WRAP_MODE, key); in crypt()
41 cip.init(Cipher.UNWRAP_MODE, key); in crypt()
42 Key decrypted = cip.unwrap(output, getAlgName(), Cipher.SECRET_KEY); in crypt()
DCipherSymmetricKeyThread.java23 import javax.crypto.Cipher;
46 Cipher cip = Cipher.getInstance(getAlgName() + "/" + getMode() + "/" + in crypt()
56 cip.init(Cipher.ENCRYPT_MODE, key, ivspec); in crypt()
61 cip.init(Cipher.DECRYPT_MODE, key, ivspec); in crypt()
64 cip.init(Cipher.ENCRYPT_MODE, key); in crypt()
67 cip.init(Cipher.DECRYPT_MODE, key); in crypt()
DCipherRSAThread.java22 import javax.crypto.Cipher;
40 Cipher cip = Cipher.getInstance(getAlgName() + "/" + getMode() + "/" + in crypt()
42 cip.init(Cipher.ENCRYPT_MODE, kp.getPublic()); in crypt()
45 cip.init(Cipher.DECRYPT_MODE, kp.getPrivate()); in crypt()
DCipherPBEThread.java22 import javax.crypto.Cipher;
46 Cipher cip = Cipher.getInstance(getAlgName() + "/" + getMode() + "/" + in crypt()
52 cip.init(Cipher.ENCRYPT_MODE, key, parSpec); in crypt()
55 cip.init(Cipher.DECRYPT_MODE, key, parSpec); in crypt()
/libcore/benchmarks/src/benchmarks/regression/
DCipherBenchmark.java30 import javax.crypto.Cipher;
96 private Cipher cipherEncrypt;
98 private Cipher cipherDecrypt;
130 cipherEncrypt = Cipher.getInstance(cipherAlgorithm, providerName); in setUp()
131 cipherEncrypt.init(Cipher.ENCRYPT_MODE, key, spec); in setUp()
133 cipherDecrypt = Cipher.getInstance(cipherAlgorithm, providerName); in setUp()
134 cipherDecrypt.init(Cipher.DECRYPT_MODE, key, spec); in setUp()
DCipherInputStreamBenchmark.java35 import javax.crypto.Cipher;
62 private Cipher cipherEncrypt;
73 cipherEncrypt = Cipher.getInstance("AES/CBC/PKCS5Padding"); in setUp()
74 cipherEncrypt.init(Cipher.ENCRYPT_MODE, key, spec); in setUp()
79 cipherEncrypt.init(Cipher.ENCRYPT_MODE, key, spec); in timeEncrypt()
/libcore/support/src/test/java/tests/security/
DCipherSymmetricCryptHelper.java19 import javax.crypto.Cipher;
27 super(algorithmName, plainData, Cipher.ENCRYPT_MODE, in CipherSymmetricCryptHelper()
28 Cipher.DECRYPT_MODE); in CipherSymmetricCryptHelper()
DCipherAsymmetricCryptHelper.java20 import javax.crypto.Cipher;
27 super(algorithmName, plainData, Cipher.ENCRYPT_MODE, in CipherAsymmetricCryptHelper()
28 Cipher.DECRYPT_MODE); in CipherAsymmetricCryptHelper()
DAlgorithmParameterAsymmetricHelper.java27 import javax.crypto.Cipher;
56 Cipher cipher = null; in test()
58 cipher = Cipher.getInstance(algorithmName); in test()
66 cipher.init(Cipher.ENCRYPT_MODE, keyPair.getPublic(), parameters); in test()
83 cipher.init(Cipher.DECRYPT_MODE, keyPair.getPrivate(), parameters); in test()
DAlgorithmParameterSymmetricHelper.java26 import javax.crypto.Cipher;
64 Cipher cipher = null; in test()
71 cipher = Cipher.getInstance(transformation); in test()
79 cipher.init(Cipher.ENCRYPT_MODE, key, parameters); in test()
96 cipher.init(Cipher.DECRYPT_MODE, key, parameters); in test()
DCipherHelper.java23 import javax.crypto.Cipher;
43 Cipher cipher = null; in test()
45 cipher = Cipher.getInstance(algorithmName); in test()
73 public byte[] crypt(Cipher cipher, byte[] input) { in crypt()
/libcore/luni/src/main/java/javax/crypto/
DSealedObject.java98 public SealedObject(Serializable object, Cipher c) in SealedObject()
173 Cipher cipher = Cipher.getInstance(sealAlg); in getObject()
177 cipher.init(Cipher.DECRYPT_MODE, key, params); in getObject()
179 cipher.init(Cipher.DECRYPT_MODE, key); in getObject()
223 public final Object getObject(Cipher c) in getObject()
261 Cipher cipher = Cipher.getInstance(sealAlg, provider); in getObject()
265 cipher.init(Cipher.DECRYPT_MODE, key, params); in getObject()
267 cipher.init(Cipher.DECRYPT_MODE, key); in getObject()
DEncryptedPrivateKeyInfo.java240 public PKCS8EncodedKeySpec getKeySpec(Cipher cipher) in getKeySpec()
284 Cipher cipher = Cipher.getInstance(algName); in getKeySpec()
286 cipher.init(Cipher.DECRYPT_MODE, decryptKey); in getKeySpec()
288 cipher.init(Cipher.DECRYPT_MODE, decryptKey, algParameters); in getKeySpec()
343 Cipher cipher = Cipher.getInstance(algName, providerName); in getKeySpec()
345 cipher.init(Cipher.DECRYPT_MODE, decryptKey); in getKeySpec()
347 cipher.init(Cipher.DECRYPT_MODE, decryptKey, algParameters); in getKeySpec()
397 Cipher cipher = Cipher.getInstance(algName, provider); in getKeySpec()
399 cipher.init(Cipher.DECRYPT_MODE, decryptKey); in getKeySpec()
401 cipher.init(Cipher.DECRYPT_MODE, decryptKey, algParameters); in getKeySpec()
DNullCipher.java35 public class NullCipher extends Cipher {
43 this.init(Cipher.ENCRYPT_MODE, (Key)null, (SecureRandom)null); in NullCipher()
DCipherOutputStream.java37 private final Cipher cipher;
48 public CipherOutputStream(OutputStream os, Cipher c) { in CipherOutputStream()
DCipherInputStream.java38 private final Cipher cipher;
58 public CipherInputStream(InputStream is, Cipher c) { in CipherInputStream()

12