Forums Register Login

How to Decrypt the file already Encrypted by PGP tool

+Pie Number of slices to send: Send
Short: How to Decrypt the file which is already Encrypted by PGP tool by using Java.
Hi All,
Detail: I need a solution (but i don't know it was possible or not? ) I have some of the files with Encrypted by PGP third patry tool (ex:XXXXXX.pgp)and i have KeyFile called abc.skr(this file is combination of PrivateKey and Public Key). Now i want to Decrypt the file with Java progarmme. Can u please help me what exactly i suppose to do..?
Here my code:
try
{
FileInputStream keyfis = new FileInputStream ("D:\\punna_Decrypt\\classes\\abc.skr");// Keypair file reding
byte[] encKey = new byte[keyfis.available()];
keyfis.read(encKey);
// KeyPairGenerator generator = KeyPairGenerator.getInstance("DSA");
PKCS8EncodedKeySpec privKeySpec = new KCS8EncodedKeySpec(encKey);
KeyFactory keyFactory = KeyFactory.getInstance("DSA");
PrivateKey privKey = keyFactory.generatePrivate(privKeySpec);
// the Exception is:
java.security.spec.InvalidKeySpecException: Inappropriate key specification: invalid key format
I was new for security concepts, i gone through some of the cryptography doucements for gathering information but stil i was dylama... (
thax in advance
A P Rao deat
+Pie Number of slices to send: Send
This is a duplicate of this post. I'm closing this one.
Remember to always leap before you look. But always take the time to smell the tiny ads:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com


Reply locked
This thread has been viewed 3662 times.
Similar Threads
How to Decrypt the file which is already Encrypted by PGP tool by using Java.
Java security and SSO question
Java security and SSO question
unable to read key values from file
need to generate RSA keys from txt files
More...

All times above are in ranch (not your local) time.
The current ranch time is
Apr 16, 2024 04:51:42.