JCE Query : How to Initialize Cipher for Encrypt/Decrypt

Vishal Goenka (vgoenka@novell.com)
Sat, 10 Jan 1998 15:54:45 -0700

Message-Id: <s4b799db.043@novell.com>
Date: Sat, 10 Jan 1998 15:54:45 -0700
From: Vishal Goenka <vgoenka@novell.com>
To: java-security@web1.javasoft.com
Subject: JCE Query : How to Initialize Cipher for Encrypt/Decrypt

Couple of questions on usage of Cipher class :

1. The methods do not seem to take any parameter that may specify whether
the Cipher has to be used for encryption or decryption.
2. Since all methods (except constructor) are final, it appears that the
provider must extend CipherSpi. Does Cipher.getInstance() instantiates the
Provider's CipherSpi and pass that as an argument to the Cipher constructor,
or, does it instantiate the provider's Cipher (subclass of Cipher) and the
subclass is expected to call super(providerCipherSpi, ....).

I would appreciate if some more documentation on usage of JCE classes in
general is made available. Source code would do too, but I guess that is not
distributed right now ?

Regards,
Vishal Goenka
Novell