Home
last modified time | relevance | path

Searched refs:Cipher (Results 1 – 25 of 37) 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()
/libcore/luni/src/test/java/libcore/javax/crypto/
DCipherTest.java53 import javax.crypto.Cipher;
138 return Cipher.WRAP_MODE; in getEncryptMode()
140 return Cipher.ENCRYPT_MODE; in getEncryptMode()
145 return Cipher.UNWRAP_MODE; in getDecryptMode()
147 return Cipher.DECRYPT_MODE; in getDecryptMode()
373 setExpectedBlockSize("RSA", Cipher.ENCRYPT_MODE, 256);
374 setExpectedBlockSize("RSA/ECB/NoPadding", Cipher.ENCRYPT_MODE, 256);
375 setExpectedBlockSize("RSA/ECB/PKCS1Padding", Cipher.ENCRYPT_MODE, 245);
378 setExpectedBlockSize("RSA", Cipher.ENCRYPT_MODE, "BC", 255);
379 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/benchmarks/src/benchmarks/regression/
DProviderBenchmark.java21 import javax.crypto.Cipher;
26 Cipher c = Cipher.getInstance("RSA"); in timeStableProviders()
34 Cipher c = Cipher.getInstance("RSA"); in timeWithNewProvider()
DCipherInputStreamBenchmark.java23 import javax.crypto.Cipher;
53 private Cipher cipherEncrypt;
65 cipherEncrypt = Cipher.getInstance("AES/CBC/PKCS5Padding"); in setUp()
66 cipherEncrypt.init(Cipher.ENCRYPT_MODE, key, spec); in setUp()
71 cipherEncrypt.init(Cipher.ENCRYPT_MODE, key, spec); in timeEncrypt()
DCipherBenchmark.java24 import javax.crypto.Cipher;
92 private Cipher cipherEncrypt;
94 private Cipher cipherDecrypt;
127 cipherEncrypt = Cipher.getInstance(cipherAlgorithm, providerName); in setUp()
128 cipherEncrypt.init(Cipher.ENCRYPT_MODE, key, spec); in setUp()
130 cipherDecrypt = Cipher.getInstance(cipherAlgorithm, providerName); in setUp()
131 cipherDecrypt.init(Cipher.DECRYPT_MODE, key, spec); in setUp()
/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/support/src/test/java/tests/security/
DAlgorithmParameterAsymmetricHelper.java27 import javax.crypto.Cipher;
47 Cipher cipher = Cipher.getInstance(algorithmName); in test()
48 cipher.init(Cipher.ENCRYPT_MODE, keyPair.getPublic(), parameters); in test()
51 cipher.init(Cipher.DECRYPT_MODE, keyPair.getPrivate(), parameters); in test()
DAlgorithmParameterSymmetricHelper.java26 import javax.crypto.Cipher;
61 Cipher cipher = Cipher.getInstance(transformation); in test()
62 cipher.init(Cipher.ENCRYPT_MODE, key, parameters); in test()
65 cipher.init(Cipher.DECRYPT_MODE, key, parameters); in test()
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()
DCipherHelper.java23 import javax.crypto.Cipher;
43 Cipher cipher = Cipher.getInstance(algorithmName); in test()
/libcore/ojluni/src/main/java/javax/crypto/
DSealedObject.java148 public SealedObject(Serializable object, Cipher c) throws IOException, in SealedObject()
288 public final Object getObject(Cipher c) in getObject()
395 Cipher c; in unseal()
398 c = Cipher.getInstance(this.sealAlg, provider); in unseal()
400 c = Cipher.getInstance(this.sealAlg); in unseal()
415 c.init(Cipher.DECRYPT_MODE, key, params); in unseal()
417 c.init(Cipher.DECRYPT_MODE, key); in unseal()
DEncryptedPrivateKeyInfo.java246 public PKCS8EncodedKeySpec getKeySpec(Cipher cipher) in getKeySpec()
278 Cipher c; in getKeySpecImpl()
282 c = Cipher.getInstance(algid.getName()); in getKeySpecImpl()
284 c = Cipher.getInstance(algid.getName(), provider); in getKeySpecImpl()
286 c.init(Cipher.DECRYPT_MODE, decryptKey, algid.getParameters()); in getKeySpecImpl()
DCipher.java625 public class Cipher { class
700 protected Cipher(CipherSpi cipherSpi, in Cipher() method in Cipher
719 private Cipher(CipherSpi cipherSpi, in Cipher() method in Cipher
800 public static final Cipher getInstance(String transformation) in getInstance()
845 public static final Cipher getInstance(String transformation, in getInstance()
894 public static final Cipher getInstance(String transformation, in getInstance()
904 static final Cipher createCipher(String transformation, Provider provider) in createCipher()
927 return new Cipher(null, provider, transformation, tokenizedTransformation); in createCipher()
1608 (((opmode == Cipher.ENCRYPT_MODE) && in init()
1611 ((opmode == Cipher.WRAP_MODE) && in init()
[all …]
DCipherOutputStream.java66 private Cipher cipher;
88 public CipherOutputStream(OutputStream os, Cipher c) { in CipherOutputStream()
/libcore/ojluni/src/main/java/sun/security/ssl/
DRSAClientKeyExchange.java111 Cipher cipher = JsseJce.getCipher(JsseJce.CIPHER_RSA_PKCS1); in RSAClientKeyExchange()
112 cipher.init(Cipher.WRAP_MODE, publicKey, generator); in RSAClientKeyExchange()
144 Cipher cipher = JsseJce.getCipher(JsseJce.CIPHER_RSA_PKCS1); in RSAClientKeyExchange()
145 cipher.init(Cipher.UNWRAP_MODE, privateKey); in RSAClientKeyExchange()
147 "TlsRsaPremasterSecret", Cipher.SECRET_KEY); in RSAClientKeyExchange()

12