Vishal, As far as i can figure out...WRAP_MODE is used for keys, ENCRYPT_MODE is used for the data itself.
-- dims --- Vishal Mahajan <[EMAIL PROTECTED]> wrote: > All, > > Can someone explain what's the difference between the following two ways > of initializing the javax.crypto.Cipher class for encrypting a symmetric > key: > > 1) Cipher.init(WRAP_MODE, RSAPublicKey) > > 2) Cipher.init(ENCRYPT_MODE, RSAPublicKey) > > I observe that XMLCipher.encryptKey() method always initializes the > _contextCipher (javax.crypto.Cipher object) in WRAP_MODE. > > Thanks in advance, > Vishal > ===== Davanum Srinivas - http://webservices.apache.org/~dims/