> Hi,
>
[quoted text clipped - 6 lines]
>
> Ganesh
Hi,
Encrypting data with a private key does not make sense. The purpose of
encrypting data is to hide it from all but the intended recipient.
Since all operations done by a private key are undone by the public
key, if you were to encrypt with your private key, that would mean
anyone who had your public key (i.e. anyone at all) could decrypt,
which would be pointless. Encrypting is always done with the public
key, so that only the intended recipient (who has the private key)
can decrypt.
If you wanted to encrypt with the private key so that you could "try"
to decrypt with the public key, with the idea being that if the
decryption works right, it must have been encrypted with the proper
private key in the first place, then you're not looking for
encryption. What you want is signing, available in
java.security.Signature. A Signature object allows you to pass in the
data to sign, and will later output a small block of bytes. You send
the original data and the block of bytes together. The recipient can
use the Signature object along with the original data and the
signature bytes (and your public key) to verify the signature.
Chris
I am having the same issue. The SecretKey gets us the mimimum we need.
Why is this not supported in the latest builds from IBM?