|
From: <CPe...@ro...> - 2003-05-28 11:41:22
|
NYI means Not Yet Implemented
=
=
=20
WolverinE =
=
=20
<wol...@ya...> Pour : c=
ryp...@li... =
=20
Envoy=E9 par : cc : =
=
=20
cry...@li... Objet : [=
Cryptix-users] Symmetric Decryption Problem + Revocation =
=20
ceforge.net =
=
=20
=
=
=20
=
=
=20
28/05/03 13:09 =
=
=20
=
=
=20
=
=
=20
HI
I am working on Web Mail Security and is on deadline
and Symmetric Based Document Encryption is remaining.
The Encryption process is done well but running the
atttached file SymmetricDecryptor code generates the
RuntimeException and not quiet not getting the
solution
Exception : java.lang.RuntimeException: NYI
NYI
There was a good discussion on revocation on this list
and i found one class X509CRL for generating X.509
Revocation Certificate..I do not think any class is
available similar one for OpenPGP..Is there any option
for generating such certificate for OpenPGP
Thanks for the reply....!
__________________________________
Do you Yahoo!?
Yahoo! Calendar - Free online calendar with sync to Outlook(TM).
http://calendar.yahoo.com
import cryptix.message.EncryptedMessage;
import cryptix.message.LiteralMessage;
import cryptix.message.Message;
import cryptix.message.MessageException;
import cryptix.message.MessageFactory;
import cryptix.message.NotEncryptedToParameterException;
import java.io.FileInputStream;
import java.io.IOException;
import java.security.NoSuchAlgorithmException;
import java.security.UnrecoverableKeyException;
import java.util.Collection;
public class SymmetricDecryptor
{
public static void main(String args[])
{
// Dynamically register both the Cryptix JCE and Cryptix OpenP=
GP
// providers.
java.security.Security.addProvider(new
cryptix.jce.provider.CryptixCrypto());
java.security.Security.addProvider(new
cryptix.openpgp.provider.CryptixOpenPGP());
// read, decrypt and display the message
symmetricDecrypt();
}
public static void symmetricDecrypt()
{
// Read the encrypted message
EncryptedMessage em =3D null;
try
{
FileInputStream fis =3D new FileInputStream("doc");
MessageFactory mf =3D MessageFactory.getInstance("OpenPGP");
Collection msgs =3D mf.generateMessages(fis);
em =3D (EncryptedMessage) msgs.iterator().next();
fis.close();
}
catch(IOException ioe)
{
System.out.println("Exception : " + ioe);
System.exit(-1);
}
catch(MessageException me)
{
System.out.println("Exception : " + me);
System.exit(-1);
}
catch(NoSuchAlgorithmException nsae)
{
System.out.println("Exception : " + nsae);
System.exit(-1);
}
// Decrypt the message and display the original message
LiteralMessage msg =3D null;
try
{
String str =3D "Passphrase";
msg =3D (LiteralMessage)em.decrypt(str.toCharArray());
System.out.println(msg.getTextData());
}
catch(NotEncryptedToParameterException netpe)
{
System.out.println("Exception : " + netpe);
System.exit(-1);
}
catch(MessageException me)
{
System.out.println("Exception : " + me);
System.exit(-1);
}
catch(Exception e)
{
System.out.println("Exception : " + e);
System.out.println(e.getMessage());
System.exit(-1);
}
}
}
=
|