aspose file tools
The moose likes Other JSE/JEE APIs and the fly likes How to Decrypt the file already Encrypted by PGP tool Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » Other JSE/JEE APIs
Reply locked New topic
Author

How to Decrypt the file already Encrypted by PGP tool

A P Rao
Greenhorn

Joined: Feb 18, 2002
Posts: 3
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
Marilyn de Queiroz
Sheriff

Joined: Jul 22, 2000
Posts: 9001
This is a duplicate of this post. I'm closing this one.


JavaBeginnersFaq
"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
 
 
subject: How to Decrypt the file already Encrypted by PGP tool
 
Threads others viewed
Java security and SSO question
How to Decrypt the file which is already Encrypted by PGP tool by using Java.
unable to read key values from file
Java security and SSO question
problem with RSA..... folks please help!
WebSphere development made easy
without the weight of IBM tools
http://www.myeclipseide.com

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture