This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
i'am trying to create a public key object. this is my code :
1- EncodedKeySpec pubKeySpec = new X509EncodedKeySpec(pkbytes); 2- KeyFactory keyFactory = KeyFactory.getInstance("DSA"); 2- PublicKey pubKey = keyFactory.generatePublic(pubKeySpec); 3- signAl = Signature.getInstance(SHA1withDSA);
where pkbytes is an array of bytes that i've created from the file that content the public key but when i execute the programm, i get an this exception InvalidKeySpecException.Someone has an idea ? thank you.