commons-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r677186 - /commons/sandbox/openpgp/trunk/src/main/java/org/apache/commons/openpgp/BouncyCastleOpenPgpStreamingSignatureVerifier.java
Date Wed, 16 Jul 2008 07:47:35 GMT
Author: brett
Date: Wed Jul 16 00:47:33 2008
New Revision: 677186

URL: http://svn.apache.org/viewvc?rev=677186&view=rev
Log:
handle missing keys more elegantly

Modified:
    commons/sandbox/openpgp/trunk/src/main/java/org/apache/commons/openpgp/BouncyCastleOpenPgpStreamingSignatureVerifier.java

Modified: commons/sandbox/openpgp/trunk/src/main/java/org/apache/commons/openpgp/BouncyCastleOpenPgpStreamingSignatureVerifier.java
URL: http://svn.apache.org/viewvc/commons/sandbox/openpgp/trunk/src/main/java/org/apache/commons/openpgp/BouncyCastleOpenPgpStreamingSignatureVerifier.java?rev=677186&r1=677185&r2=677186&view=diff
==============================================================================
--- commons/sandbox/openpgp/trunk/src/main/java/org/apache/commons/openpgp/BouncyCastleOpenPgpStreamingSignatureVerifier.java
(original)
+++ commons/sandbox/openpgp/trunk/src/main/java/org/apache/commons/openpgp/BouncyCastleOpenPgpStreamingSignatureVerifier.java
Wed Jul 16 00:47:33 2008
@@ -77,6 +77,12 @@
 
             sig = p3.get( 0 );
             PGPPublicKey key = keyRing.getPublicKey( sig.getKeyID() );
+            
+            if ( key == null )
+            {
+                throw new OpenPgpException( "Unable to find key with key ID '"
+                    + Long.toHexString( sig.getKeyID() ).toUpperCase() + "' in public key
ring" );
+            }
 
             sig.initVerify( key, "BC" );
         }
@@ -139,9 +145,4 @@
             throw new OpenPgpException( "Error calculating detached signature", e );
         }
     }
-
-    public SignatureStatus verify()
-    {
-        return null;  //To change body of implemented methods use File | Settings | File
Templates.
-    }
 }



Mime
View raw message