Author: ogusakov Date: Thu Apr 2 04:45:00 2009 New Revision: 761165 URL: http://svn.apache.org/viewvc?rev=761165&view=rev Log: improving PGP utilities
Modified: maven/mercury/trunk/mercury-crypto/mercury-crypto-basic/src/main/java/org/apache/maven/mercury/crypto/pgp/PgpHelper.java maven/mercury/trunk/mercury-crypto/mercury-crypto-basic/src/main/java/org/apache/maven/mercury/crypto/pgp/PgpStreamVerifierFactory.java maven/mercury/trunk/mercury-wagon/pom.xml Modified: maven/mercury/trunk/mercury-crypto/mercury-crypto-basic/src/main/java/org/apache/maven/mercury/crypto/pgp/PgpHelper.java URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-crypto/mercury-crypto-basic/src/main/java/org/apache/maven/mercury/crypto/pgp/PgpHelper.java?rev=761165&r1=761164&r2=761165&view=diff ============================================================================== --- maven/mercury/trunk/mercury-crypto/mercury-crypto-basic/src/main/java/org/apache/maven/mercury/crypto/pgp/PgpHelper.java (original) +++ maven/mercury/trunk/mercury-crypto/mercury-crypto-basic/src/main/java/org/apache/maven/mercury/crypto/pgp/PgpHelper.java Thu Apr 2 04:45:00 2009 @@ -188,11 +188,17 @@ StreamVerifierAttributes attributes = new StreamVerifierAttributes(PgpStreamVerifierFactory.DEFAULT_EXTENSION, false, true); PgpStreamVerifierFactory svf = new PgpStreamVerifierFactory( attributes, publicKeyRingStream ); - - PgpStreamVerifier sv = (PgpStreamVerifier)svf.newInstance(); - String sig = PgpHelper.streamToString( asc ); + return verifyStream( in, sig, svf ); + } + //--------------------------------------------------------------------------------- + public static final boolean verifyStream( InputStream in, String sig, PgpStreamVerifierFactory factory ) + throws IOException, StreamObserverException + { + + PgpStreamVerifier sv = (PgpStreamVerifier)factory.newInstance(); + sv.initSignature( sig ); int nBytes = -1; Modified: maven/mercury/trunk/mercury-crypto/mercury-crypto-basic/src/main/java/org/apache/maven/mercury/crypto/pgp/PgpStreamVerifierFactory.java URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-crypto/mercury-crypto-basic/src/main/java/org/apache/maven/mercury/crypto/pgp/PgpStreamVerifierFactory.java?rev=761165&r1=761164&r2=761165&view=diff ============================================================================== --- maven/mercury/trunk/mercury-crypto/mercury-crypto-basic/src/main/java/org/apache/maven/mercury/crypto/pgp/PgpStreamVerifierFactory.java (original) +++ maven/mercury/trunk/mercury-crypto/mercury-crypto-basic/src/main/java/org/apache/maven/mercury/crypto/pgp/PgpStreamVerifierFactory.java Thu Apr 2 04:45:00 2009 @@ -69,6 +69,15 @@ } //-------------------------------------------------------------------------------------------- public PgpStreamVerifierFactory( StreamVerifierAttributes attributes + , PGPPublicKeyRingCollection trustedPublicKeyRing + ) + throws StreamVerifierException + { + super( attributes ); + this.trustedPublicKeyRing = trustedPublicKeyRing; + } + //-------------------------------------------------------------------------------------------- + public PgpStreamVerifierFactory( StreamVerifierAttributes attributes , InputStream secretKeyRingStream , String secretKeyId , String secretKeyPass Modified: maven/mercury/trunk/mercury-wagon/pom.xml URL: http://svn.apache.org/viewvc/maven/mercury/trunk/mercury-wagon/pom.xml?rev=761165&r1=761164&r2=761165&view=diff ============================================================================== --- maven/mercury/trunk/mercury-wagon/pom.xml (original) +++ maven/mercury/trunk/mercury-wagon/pom.xml Thu Apr 2 04:45:00 2009 @@ -61,6 +61,17 @@ <groupId>org.codehaus.plexus</groupId> <artifactId>plexus-utils</artifactId> </dependency> + <dependency> + <groupId>bouncycastle</groupId> + <artifactId>bcprov-jdk15</artifactId> + <optional>true</optional> + </dependency> + + <dependency> + <groupId>bouncycastle</groupId> + <artifactId>bcpg-jdk15</artifactId> + <optional>true</optional> + </dependency> </dependencies> <build>