RSA with j2se1.4.2

Q

qwerty

Hi,

I compile this code with J2SDK 1.4.2:

byte[] pk=...................; (128 byte from GPK8000 public key)

X509EncodedKeySpec pubKeySpec = new X509EncodedKeySpec(pk);
KeyFactory keyFactory = KeyFactory.getInstance("RSA");
PublicKey pubKey = keyFactory.generatePublic(pubKeySpec);


Bat I have this error message:
java.security.spec.InvalidKeySpecException: Unknown key spec: Could not
decode public key from BER.

Where I have mistake?



Ciao.
CC
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,186
Members
46,740
Latest member
JudsonFrie

Latest Threads

Top