libcommons-openpgp-java/ 0000755 0001750 0001750 00000000000 10620447146 014275 5 ustar paul paul libcommons-openpgp-java/pom.xml 0000755 0001750 0001750 00000005252 10550005561 015612 0 ustar paul paul
4.0.0
org.apache.commons
commons-sandbox
1-SNAPSHOT
commons-openpgp
1.0-SNAPSHOT
Commons OpenPGP
http://jakarta.apache.org/commons/sandbox/openpgp/
2005
org.bouncycastle
bcpg-jdk12
130
junit
junit
3.8.1
test
ant
ant
1.6.5
compile
ant
ant-launcher
1.6.5
runtime
src/main/resources
true
brett
Brett Porter
brett AT apache DOT org
Apache
+10
bodewig
Stefan Bodewig
bodewig AT apache DOT org
Apache
+1
scm:svn:http://svn.apache.org/repos/asf/jakarta/commons/sandbox/openpgp/trunk/
scm:svn:https://svn.apache.org/repos/asf/jakarta/commons/sandbox/openpgp/trunk/
http://svn.apache.org/repos/asf/jakarta/commons/sandbox/openpgp/trunk/
website
Apache Website
scp://people.apache.org/www/jakarta.apache.org/commons/sandbox/openpgp/
1.3
1.3
libcommons-openpgp-java/src/ 0000755 0001750 0001750 00000000000 10620447145 015063 5 ustar paul paul libcommons-openpgp-java/src/site/ 0000755 0001750 0001750 00000000000 10620447146 016030 5 ustar paul paul libcommons-openpgp-java/src/site/apt/ 0000755 0001750 0001750 00000000000 10620447146 016614 5 ustar paul paul libcommons-openpgp-java/src/site/apt/index.apt 0000755 0001750 0001750 00000001270 10550006311 020417 0 ustar paul paul -----
Home
-----
Brett Porter
-----
10 December 2005
-----
Jakarta Commons OpenPGP
Commons OpenPGP was started to produce a common and simple interface for generating
and verifying OpenPGP signatures.
Currently implemented using {{{http://www.bouncycastle.org} BouncyCastle}}, it is
intended to allow pluggable providers so that alternate open source and commercial
providers can be used.
* History
The library was started by Maven and Ant committers to enable the use of OpenPGP
from these tools. Currently, Maven uses it in its development version to sign
libraries released to the repository.
* Using the Library
* {{{usage.html} Usage Instructions}}
libcommons-openpgp-java/src/site/apt/signer.apt 0000644 0001750 0001750 00000007616 10552023307 020614 0 ustar paul paul -----
Signer Ant Task
-----
Antoine Levy-Lambert
-----
12 October 2006
-----
Signer Ant Task
This task will be packaged in the commons-openpgp.jar.
It will use the bouncy castle jars at runtime. It has been tested with bcpg-jdk12-134.jar and bcprov-jdk12-134.jar.
The generated signatures can be verified with gpg.
<<>> can sign one or several files at once.
* <<>>
*------------------+--------------------------------------------------------------------------+-------------------------------------------------+
| Attribute | Description | Required |
*------------------+--------------------------------------------------------------------------+-------------------------------------------------+
| <<>> | Secret key ring file. | Yes |
*------------------+--------------------------------------------------------------------------+-------------------------------------------------+
| <<>> | Public key ring file. | Yes |
*------------------+--------------------------------------------------------------------------+-------------------------------------------------+
| <<>> | Password of the secret key ring. | Yes |
*------------------+--------------------------------------------------------------------------+-------------------------------------------------+
| <<>> | Id of the key used to sign. | Yes |
*------------------+--------------------------------------------------------------------------+-------------------------------------------------+
| <<>> | Boolean, defaults to true. | No |
*------------------+--------------------------------------------------------------------------+-------------------------------------------------+
| <<>> | The file that you want to sign. | No, if fileset nested element present. |
*------------------+--------------------------------------------------------------------------+-------------------------------------------------+
The task must also take either one or several nested <<>> element, or an <<>> attribute.
** <<>> nested element
The task can take one or several fileset nested elements.
See the {{{http://ant.apache.org/manual/CoreTypes/fileset.html} ant manual}} for an explanation.
If you want to sign just one file, the <<>> attribute can be used instead.
** <<>> nested element
The task may take a {{{http://ant.apache.org/manual/CoreTypes/mapper.html} mapper}} nested element.
This nested element tells the task how the signature files should be called.
If you do not supply this element, the signature files will be located in the same directory as the files that
you sign. An ending of <<<.asc>>> will be appended to the file name for ascii armored output (the default).
If you set <<>> to false, the ending will be <<<.sig>>>
* example
-----
-----
libcommons-openpgp-java/src/site/apt/usage.apt 0000755 0001750 0001750 00000005432 10550006311 020420 0 ustar paul paul -----
Usage
-----
Brett Porter
-----
10 December 2005
-----
Usage Instructions
Currently only creation and verification of detached signatures is supported. This can be done in streaming and
non-streaming mode.
Both modes require that you have created a key ring.
* Creating a Key Ring
A key ring object needs to be created, containing an input stream for both the public and secret key rings.
The password for the secret key ring also needs to be passed in for creating signatures.
For example, to create the Bouncy Castle key ring, the constructor is used:
-----
BouncyCastleKeyRing( InputStream secretKeyRing, InputStream publicKeyRing, char[] password );
-----
* Non-streaming Mode
~~TODO: link to Javadoc
To sign data with a detached signature, create a <<>>.
-----
signer = new BouncyCastleOpenPgpSigner();
signer.detachedSign(
getClass().getResourceAsStream( "/test-input" ), // binary input file
signature, // outputstream for the signature
keyId, // key ID
keyRing,
true ); // ascii armor
-----
Verifying the signature is similar.
-----
verifier = new BouncyCastleOpenPgpSignatureVerifier();
verifier.verifyDetachedSignature(
getClass().getResourceAsStream( "/test-input" ), // binary input file
signature, // inputstream for the signature
keyRing,
true ); // ascii armor
-----
* Streaming Mode
~~TODO: link to Javadoc
To sign data in streaming mode, create an instance of <<>>.
The <<>> method is called on blocks of data to update the signautre. Finally, <<>> is called
to receive the detached signature as a byte array.
-----
signer = new BouncyCastleOpenPgpStreamingSigner(
new FileOutputStream( "file.asc" ), // detached signature
"ABC123D", // key ID
keyRing,
true ); // ascii armor?
int len;
do
{
len = read( buf );
if ( len > 0 )
{
signer.update( buf );
}
}
while ( len >= 0 );
byte[] signature = signer.finish();
-----
To verify a signature in streaming mode is similar.
-----
verifier = new BouncyCastleOpenPgpStreamingSignatureVerifier(
new FileInputStream( "file.asc" ), // detached signature
keyRing,
true ); // ascii armor?
int len;
do
{
len = read( buf );
if ( len > 0 )
{
verifier.update( buf );
}
}
while ( len >= 0 );
SignatureStatus status = verifier.finish();
-----
The <<>> returned indicates whether the signature was valid and whether it was trusted.
libcommons-openpgp-java/src/site/site.xml 0000755 0001750 0001750 00000000746 10550005521 017515 0 ustar paul paul
libcommons-openpgp-java/src/main/ 0000755 0001750 0001750 00000000000 10620447145 016007 5 ustar paul paul libcommons-openpgp-java/src/main/resources/ 0000755 0001750 0001750 00000000000 10620447145 020021 5 ustar paul paul libcommons-openpgp-java/src/main/resources/org/ 0000755 0001750 0001750 00000000000 10620447145 020610 5 ustar paul paul libcommons-openpgp-java/src/main/resources/org/apache/ 0000755 0001750 0001750 00000000000 10620447145 022031 5 ustar paul paul libcommons-openpgp-java/src/main/resources/org/apache/commons/ 0000755 0001750 0001750 00000000000 10620447145 023504 5 ustar paul paul libcommons-openpgp-java/src/main/resources/org/apache/commons/openpgp/ 0000755 0001750 0001750 00000000000 10620447145 025154 5 ustar paul paul libcommons-openpgp-java/src/main/resources/org/apache/commons/openpgp/ant/ 0000755 0001750 0001750 00000000000 10620447145 025736 5 ustar paul paul libcommons-openpgp-java/src/main/resources/org/apache/commons/openpgp/ant/antlib.xml 0000644 0001750 0001750 00000000232 10550004071 027713 0 ustar paul paul