Public Key Encryption

Hi guys,I have to sign some data (a byte array) using a Public Key.How can I do that?(I know it's a bit strange..but I have to do this....)Thanks a lot...bye!!
[195 byte] By [rocker184a] at [2007-11-26 14:24:39]
# 1
Signing is done with the private key. Why can't you use the Signature class?
ghstarka at 2007-7-8 2:17:23 > top of Java-index,Security,Cryptography...
# 2

What you're really asking for is to do something with the data that only the owner of the Private Key can use. What you should be looking at is encryption with the Public Key and not Signing with the Public Key. You will find many examples on this forum, in the JCE web-pages at Sun and in David Hook's Book "Beginning Cryptography in Java".

arshad.noora at 2007-7-8 2:17:23 > top of Java-index,Security,Cryptography...