Searched refs:cipher (Results 1 - 13 of 13) sorted by relevance

/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/
H A DSealedObjectTest.java92 * NullPointerException is thrown in the case of null cipher.
99 + "of null cipher.");
109 Cipher cipher = Cipher.getInstance("DES/CBC/PKCS5Padding");
110 cipher.init(Cipher.ENCRYPT_MODE, key, ips);
112 SealedObject so = new SealedObject(secret, cipher);
114 cipher = Cipher.getInstance("DES/CBC/NoPadding");
115 cipher.init(Cipher.ENCRYPT_MODE, key, ips);
118 new SealedObject(secret, cipher);
138 Cipher cipher = new NullCipher();
139 SealedObject so1 = new SealedObject(secret, cipher);
[all...]
H A DCipherTest.java92 Cipher cipher = Cipher.getInstance("DESede/CBC/PKCS5Padding");
93 assertNotNull("Received a null Cipher instance", cipher);
114 Cipher cipher = Cipher.getInstance("DES", providers[i].getName());
115 assertNotNull("Cipher.getInstance() returned a null value", cipher);
118 cipher = Cipher.getInstance("DoBeDoBeDo", providers[i]);
148 Cipher cipher = Cipher.getInstance("DES", providers[i]);
149 assertNotNull("Cipher.getInstance() returned a null value", cipher);
176 Cipher cipher = Cipher.getInstance("AES", provider.getName());
177 Provider cipherProvider = cipher.getProvider();
190 Cipher cipher
[all...]
/libcore/ojluni/src/main/java/javax/crypto/
H A DCipherOutputStream.java33 * to the underlying OutputStream. The cipher must be fully
36 * <p> For example, if the cipher is initialized for encryption, the
65 // the cipher engine to use to process stream data
66 private Cipher cipher; field in class:CipherOutputStream
84 * <br>Note: if the specified output stream or cipher is
94 cipher = c;
109 cipher = new NullCipher();
121 obuffer = cipher.update(ibuffer, 0, 1);
158 obuffer = cipher.update(b, off, len);
167 * that have already been processed by the encapsulated cipher objec
[all...]
H A DCipherInputStream.java72 // the cipher engine to use to process stream data
73 private Cipher cipher; field in class:CipherInputStream
79 underlying stream, but have not been processed by the cipher
86 /* the buffer holding data that have been processed by the cipher
119 int expectedOutputSize = cipher.getOutputSize(ibuffer.length);
127 // doFinal resets the cipher and it is the final call that is made. If there isn't
130 ofinish = cipher.doFinal(obuffer, 0);
141 ofinish = cipher.update(ibuffer, 0, readin, obuffer, 0);
146 // Should not reset the value of ofinish as the cipher is still not invalidated.
157 * <br>Note: if the specified input stream or cipher i
[all...]
H A DEncryptedPrivateKeyInfo.java232 * PKCS8EncodedKeySpec object, <code>cipher</code> needs
237 * @param cipher the initialized cipher object which will be
240 * @exception NullPointerException if <code>cipher</code>
242 * @exception InvalidKeySpecException if the given cipher is
246 public PKCS8EncodedKeySpec getKeySpec(Cipher cipher) argument
250 encoded = cipher.doFinal(encryptedData);
294 * cipher to decrypt the encrypted data.
321 * cipher to decrypt the encrypted data.
355 * cipher t
[all...]
/libcore/luni/src/test/java/libcore/javax/crypto/
H A DCipherInputStreamTest.java110 Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
111 cipher.init(Cipher.DECRYPT_MODE, key, iv);
113 InputStream cin = new CipherInputStream(in, cipher);
119 Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
120 cipher.init(Cipher.DECRYPT_MODE, key, iv);
121 InputStream in = new CipherInputStream(new ByteArrayInputStream(aesCipherText), cipher);
132 Cipher cipher = Cipher.getInstance("AES/CBC/PKCS5Padding");
133 cipher.init(Cipher.ENCRYPT_MODE, key, iv);
135 new ByteArrayInputStream(plainText.getBytes("UTF-8")), cipher);
144 Cipher cipher
[all...]
H A DCipherOutputStreamTest.java40 Cipher cipher;
42 cipher = Cipher.getInstance("AES/GCM/NoPadding", provider);
60 cipher.init(Cipher.ENCRYPT_MODE, key);
62 cipher.init(Cipher.ENCRYPT_MODE, key, params);
64 byte[] encrypted = cipher.doFinal(unencrypted);
69 cipher.init(Cipher.DECRYPT_MODE, key, params);
70 CipherOutputStream cos = new CipherOutputStream(new ByteArrayOutputStream(), cipher);
H A DCipherTest.java483 Cipher cipher = Cipher.getInstance("FOO");
484 cipher.init(Cipher.ENCRYPT_MODE, new MockKey());
485 assertEquals("MockProvider", cipher.getProvider().getName());
487 cipher.init(Cipher.ENCRYPT_MODE, new MockKey2());
489 assertEquals("MockProvider2", cipher.getProvider().getName());
517 Cipher cipher = Cipher.getInstance("FOO");
518 cipher.init(Cipher.ENCRYPT_MODE,
521 assertEquals("MockProvider", cipher.getProvider().getName());
523 cipher.init(Cipher.ENCRYPT_MODE,
527 assertEquals("MockProvider2", cipher
[all...]
/libcore/support/src/test/java/tests/security/
H A DAlgorithmParameterAsymmetricHelper.java47 Cipher cipher = Cipher.getInstance(algorithmName);
48 cipher.init(Cipher.ENCRYPT_MODE, keyPair.getPublic(), parameters);
49 byte[] bs = cipher.doFinal(plainData.getBytes());
51 cipher.init(Cipher.DECRYPT_MODE, keyPair.getPrivate(), parameters);
52 byte[] decrypted = cipher.doFinal(bs);
H A DAlgorithmParameterSymmetricHelper.java61 Cipher cipher = Cipher.getInstance(transformation);
62 cipher.init(Cipher.ENCRYPT_MODE, key, parameters);
63 byte[] bs = cipher.doFinal(plainData.getBytes());
65 cipher.init(Cipher.DECRYPT_MODE, key, parameters);
66 byte[] decrypted = cipher.doFinal(bs);
H A DCipherHelper.java43 Cipher cipher = Cipher.getInstance(algorithmName);
44 cipher.init(mode1, encryptKey);
45 byte[] encrypted = cipher.doFinal(plainData.getBytes());
47 cipher.init(mode2, decryptKey);
48 byte[] decrypted = cipher.doFinal(encrypted);
/libcore/ojluni/src/main/java/java/security/
H A DSignature.java312 // name of the equivalent cipher alg
1479 private final Cipher cipher; field in class:Signature.CipherAdapter
1483 CipherAdapter(Cipher cipher) { argument
1484 this.cipher = cipher;
1489 cipher.init(Cipher.DECRYPT_MODE, publicKey);
1499 cipher.init(Cipher.ENCRYPT_MODE, privateKey);
1505 cipher.init(Cipher.ENCRYPT_MODE, privateKey, random);
1519 byte[] out = cipher.update(b, off, len);
1528 return cipher
[all...]
/libcore/support/src/test/java/libcore/java/security/
H A DStandardNames.java46 * client and server auth types, cipher suites.
89 * signaling cipher suite value (SCSV) to indicate that this request is a
738 * either key exchange algorithm part of the cipher suite
798 // TLSv1.2 cipher suites
814 // Pre-Shared Key (PSK) cipher suites
1105 * Asserts that the cipher suites array is non-null and that it
1106 * all of its contents are cipher suites known to this
1107 * implementation. As a convenience, returns any unenabled cipher
1109 * all cipher suites were included.
1125 assertEquals("Unknown cipher suite
1268 getModesForCipher(String cipher) argument
1275 getPaddingsForCipher(String cipher) argument
[all...]

Completed in 191 milliseconds