/libcore/luni/src/test/java/org/apache/harmony/crypto/tests/javax/crypto/ |
H A D | SealedObjectTest.java | 92 * 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 D | CipherTest.java | 92 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 D | CipherOutputStream.java | 33 * 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 D | CipherInputStream.java | 72 // 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 D | EncryptedPrivateKeyInfo.java | 232 * 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 D | CipherInputStreamTest.java | 110 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 D | CipherOutputStreamTest.java | 40 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 D | CipherTest.java | 1329 * base cipher. 1376 assertEquals("Ciphers seen with mode and padding but not base cipher", 1537 // Test wrapping a key. Every cipher should be able to wrap. Except those that can't. 1884 Cipher cipher = Cipher.getInstance("RSA"); 1886 cipher.init(mode, certificate); 1889 cipher.init(mode, certificate); 4109 // Test wrapping a key. Every cipher should be able to wrap. 4227 fail("should not be able to call updateAAD on non-AEAD cipher"); 4369 Cipher cipher = createAesCipher(opmode); 4371 cipher [all...] |
/libcore/support/src/test/java/tests/security/ |
H A D | AlgorithmParameterAsymmetricHelper.java | 47 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 D | AlgorithmParameterSymmetricHelper.java | 61 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 D | CipherHelper.java | 43 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 D | Signature.java | 312 // name of the equivalent cipher alg 1427 private final Cipher cipher; field in class:Signature.CipherAdapter 1431 CipherAdapter(Cipher cipher) { argument 1432 this.cipher = cipher; 1437 cipher.init(Cipher.DECRYPT_MODE, publicKey); 1447 cipher.init(Cipher.ENCRYPT_MODE, privateKey); 1453 cipher.init(Cipher.ENCRYPT_MODE, privateKey, random); 1467 byte[] out = cipher.update(b, off, len); 1476 return cipher [all...] |
/libcore/support/src/test/java/libcore/java/security/ |
H A D | StandardNames.java | 46 * client and server auth types, cipher suites. 89 * signaling cipher suite value (SCSV) to indicate that this request is a 731 * either key exchange algorithm part of the cipher suite 791 // TLSv1.2 cipher suites 807 // Pre-Shared Key (PSK) cipher suites 1098 * Asserts that the cipher suites array is non-null and that it 1099 * all of its contents are cipher suites known to this 1100 * implementation. As a convenience, returns any unenabled cipher 1102 * all cipher suites were included. 1118 assertEquals("Unknown cipher suite 1261 getModesForCipher(String cipher) argument 1268 getPaddingsForCipher(String cipher) argument [all...] |