Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / Security / March 2004

Tip: Looking for answers? Try searching our database.

BouncyCastle and PGP

Thread view: 
Roedy Green - 05 Mar 2004 03:55 GMT
Here are some notes that will help you get started quickly with
BouncyCastle and PGP

BouncyCastle is a JCE (Java Cryptographic Extension)-compatible
library that also handles PGP. It is well regarded. The source is not
well formatted or commented. The JavaDoc is sparce and inaccurate.

You will want to download the BouncyCastle jars for:
JCE Provider
open PGP
test examples
Java Source for Open PGP

Put the jars in your ext directory.

Generating Keys

Generate a binary private/public key with:

java org.bouncycastle.openpgp.examples.RSAKeyPairGenerator charlie
"open sesame"

The public and private keys will appear as pub.bpg, and secret.bpg.
You can generate ascii *.asc ascii armoured file instead by using the
-a option like this:

java org.bouncycastle.openpgp.examples.RSAKeyPairGenerator -a charlie
"open sesame"

To generate variants look at the source code in bcpg-jdk14-122/src/
org/bouncycastleopenpgp/examples/RSAKeyPairGenerator.java

Signing A Binary File

java org.bouncycastle.openpgp.examples.SignedFileProcessor -s
anyfile.dat secret.bpg "open sesame"

Resulting signed file will appear in anyfile.dat.bpg signed, but not
encrypted.

Verifying a Signed Binary File

java org.bouncycastle.openpgp.examples.SignedFileProcessor -v
anyfile.dat.bpg pub.bpg

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.
sp - 11 Mar 2004 03:18 GMT
Hi:
  What changes required to the java.security policy file to use BouncyCastle ?

sp

> Here are some notes that will help you get started quickly with
> BouncyCastle and PGP
[quoted text clipped - 40 lines]
> java org.bouncycastle.openpgp.examples.SignedFileProcessor -v
> anyfile.dat.bpg pub.bpg
Roedy Green - 15 Mar 2004 20:33 GMT
>   What changes required to the java.security policy file to use BouncyCastle ?

For simple things, nothing.  I don't know about more complex things.

--
Canadian Mind Products, Roedy Green.
Coaching, problem solving, economical contract programming.
See http://mindprod.com/jgloss/jgloss.html for The Java Glossary.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.