james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From b...@apache.org
Subject svn commit: r823845 - in /james/jdkim/trunk/main/src: main/java/org/apache/james/jdkim/ main/java/org/apache/james/jdkim/tagvalue/ test/java/org/apache/james/jdkim/
Date Sat, 10 Oct 2009 11:53:35 GMT
Author: bago
Date: Sat Oct 10 11:53:34 2009
New Revision: 823845

URL: http://svn.apache.org/viewvc?rev=823845&view=rev
Log:
Removed dependency between PublicKeyRecord and SignatureRecord.
We treat them as information beans so it is better to not add cross logic.

Added:
    james/jdkim/trunk/main/src/test/java/org/apache/james/jdkim/DKIMVerifierTest.java   (with
props)
Modified:
    james/jdkim/trunk/main/src/main/java/org/apache/james/jdkim/DKIMVerifier.java
    james/jdkim/trunk/main/src/main/java/org/apache/james/jdkim/PublicKeyRecord.java
    james/jdkim/trunk/main/src/main/java/org/apache/james/jdkim/tagvalue/PublicKeyRecordImpl.java
    james/jdkim/trunk/main/src/test/java/org/apache/james/jdkim/PublicKeyRecordTest.java

Modified: james/jdkim/trunk/main/src/main/java/org/apache/james/jdkim/DKIMVerifier.java
URL: http://svn.apache.org/viewvc/james/jdkim/trunk/main/src/main/java/org/apache/james/jdkim/DKIMVerifier.java?rev=823845&r1=823844&r2=823845&view=diff
==============================================================================
--- james/jdkim/trunk/main/src/main/java/org/apache/james/jdkim/DKIMVerifier.java (original)
+++ james/jdkim/trunk/main/src/main/java/org/apache/james/jdkim/DKIMVerifier.java Sat Oct
10 11:53:34 2009
@@ -83,6 +83,29 @@
 	}
 
 	/**
+	 * @see org.apache.james.jdkim.PublicKeyRecord#apply(org.apache.james.jdkim.SignatureRecord)
+	 */
+	public static void apply(PublicKeyRecord pkr, SignatureRecord sign) {
+		if (!pkr.getGranularityPattern().matcher(sign.getIdentityLocalPart()).matches()) {
+			throw new IllegalStateException("inapplicable key identity local="+sign.getIdentityLocalPart()+"
Pattern: "+pkr.getGranularityPattern().pattern());
+		}
+		
+		if (!pkr.isHashMethodSupported(sign.getHashMethod())) {
+			throw new IllegalStateException("inappropriate hash for a="+sign.getHashKeyType()+"/"+sign.getHashMethod());
+		}
+		if (!pkr.isKeyTypeSupported(sign.getHashKeyType())) {
+			throw new IllegalStateException("inappropriate key type for a="+sign.getHashKeyType()+"/"+sign.getHashMethod());
+		}
+		
+		if (pkr.isDenySubdomains()) {
+			if (!sign.getIdentity().toString().toLowerCase().endsWith(("@"+sign.getDToken()).toLowerCase()))
{
+				throw new IllegalStateException("AUID in subdomain of SDID is not allowed by the public
key record.");
+			}
+		}
+		
+	}
+
+	/**
 	 * Iterates through signature's declared lookup method
 	 *
 	 * @param sign the signature record
@@ -105,7 +128,7 @@
 				// checks wether the key is applicable to the signature
 				// TODO check with the IETF group to understand if this is the right thing to do.
 				// TODO loggin
-				tempKey.apply(sign);
+				apply(tempKey, sign);
 				key = tempKey;
 			} catch (IllegalStateException e) {
 				lastPermFailure = new PermFailException("Inapplicable key: "+e.getMessage(), e);

Modified: james/jdkim/trunk/main/src/main/java/org/apache/james/jdkim/PublicKeyRecord.java
URL: http://svn.apache.org/viewvc/james/jdkim/trunk/main/src/main/java/org/apache/james/jdkim/PublicKeyRecord.java?rev=823845&r1=823844&r2=823845&view=diff
==============================================================================
--- james/jdkim/trunk/main/src/main/java/org/apache/james/jdkim/PublicKeyRecord.java (original)
+++ james/jdkim/trunk/main/src/main/java/org/apache/james/jdkim/PublicKeyRecord.java Sat Oct
10 11:53:34 2009
@@ -47,12 +47,6 @@
 
 	public abstract PublicKey getPublicKey();
 
-	/**
-	 * throws an exception when the key is not suitable to match tje signature.
-	 * @param sign a signature to be tested
-	 */
-	public abstract void apply(SignatureRecord sign);
-
 	
 	public abstract List getFlags();
 	

Modified: james/jdkim/trunk/main/src/main/java/org/apache/james/jdkim/tagvalue/PublicKeyRecordImpl.java
URL: http://svn.apache.org/viewvc/james/jdkim/trunk/main/src/main/java/org/apache/james/jdkim/tagvalue/PublicKeyRecordImpl.java?rev=823845&r1=823844&r2=823845&view=diff
==============================================================================
--- james/jdkim/trunk/main/src/main/java/org/apache/james/jdkim/tagvalue/PublicKeyRecordImpl.java
(original)
+++ james/jdkim/trunk/main/src/main/java/org/apache/james/jdkim/tagvalue/PublicKeyRecordImpl.java
Sat Oct 10 11:53:34 2009
@@ -32,7 +32,6 @@
 
 import org.apache.commons.codec.binary.Base64;
 import org.apache.james.jdkim.PublicKeyRecord;
-import org.apache.james.jdkim.SignatureRecord;
 
 public class PublicKeyRecordImpl extends TagValue implements PublicKeyRecord {
 	
@@ -168,27 +167,4 @@
 		}
 	}
 
-	/**
-	 * @see org.apache.james.jdkim.PublicKeyRecord#apply(org.apache.james.jdkim.SignatureRecord)
-	 */
-	public void apply(SignatureRecord sign) {
-		if (!getGranularityPattern().matcher(sign.getIdentityLocalPart()).matches()) {
-			throw new IllegalStateException("inapplicable key for g="+getValue("g")+" and identity
local="+sign.getIdentityLocalPart()+" Pattern: "+getGranularityPattern().pattern());
-		}
-		
-		if (!isHashMethodSupported(sign.getHashMethod())) {
-			throw new IllegalStateException("inappropriate hash method h="+getValue("h")+" and a="+sign.getHashKeyType()+"/"+sign.getHashMethod());
-		}
-		if (!isKeyTypeSupported(sign.getHashKeyType())) {
-			throw new IllegalStateException("inappropriate key type k="+getValue("k")+" and a="+sign.getHashKeyType()+"/"+sign.getHashMethod());
-		}
-		
-		if (isDenySubdomains()) {
-			if (!sign.getIdentity().toString().toLowerCase().endsWith(("@"+sign.getDToken()).toLowerCase()))
{
-				throw new IllegalStateException("AUID in subdomain of SDID is not allowed by the public
key record.");
-			}
-		}
-		
-	}
-
 }

Added: james/jdkim/trunk/main/src/test/java/org/apache/james/jdkim/DKIMVerifierTest.java
URL: http://svn.apache.org/viewvc/james/jdkim/trunk/main/src/test/java/org/apache/james/jdkim/DKIMVerifierTest.java?rev=823845&view=auto
==============================================================================
--- james/jdkim/trunk/main/src/test/java/org/apache/james/jdkim/DKIMVerifierTest.java (added)
+++ james/jdkim/trunk/main/src/test/java/org/apache/james/jdkim/DKIMVerifierTest.java Sat
Oct 10 11:53:34 2009
@@ -0,0 +1,67 @@
+/****************************************************************
+ * Licensed to the Apache Software Foundation (ASF) under one   *
+ * or more contributor license agreements.  See the NOTICE file *
+ * distributed with this work for additional information        *
+ * regarding copyright ownership.  The ASF licenses this file   *
+ * to you under the Apache License, Version 2.0 (the            *
+ * "License"); you may not use this file except in compliance   *
+ * with the License.  You may obtain a copy of the License at   *
+ *                                                              *
+ *   http://www.apache.org/licenses/LICENSE-2.0                 *
+ *                                                              *
+ * Unless required by applicable law or agreed to in writing,   *
+ * software distributed under the License is distributed on an  *
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY       *
+ * KIND, either express or implied.  See the License for the    *
+ * specific language governing permissions and limitations      *
+ * under the License.                                           *
+ ****************************************************************/
+
+package org.apache.james.jdkim;
+
+import org.apache.james.jdkim.tagvalue.PublicKeyRecordImpl;
+import org.apache.james.jdkim.tagvalue.SignatureRecordImpl;
+
+import junit.framework.TestCase;
+
+public class DKIMVerifierTest extends TestCase {
+
+	public void testApply() {
+		PublicKeyRecord pkr = new PublicKeyRecordImpl("k=rsa; t=y; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIhyR3oItOy22ZOaBrIVe9m/iME3RqOJeasANSpg2YTHTYV+Xtp4xwf5gTjCmHQEMOs0qYu0FYiNQPQogJ2t0Mfx9zNu06rfRBDjiIU9tpx2T+NGlWZ8qhbiLo5By8apJavLyqTLavyPSrvsx0B3YzC63T4Age2CDqZYA+OwSMWQIDAQAB");
+		pkr.validate();
+		DKIMVerifier.apply(pkr, new SignatureRecordImpl("v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject:from:to:content-type;
bh=AbPsrGRdyVjM2e5ZZdhQA/aLe305f2bPvPRohUxrGjo=; b=ksNsfQJv20M9/Vf66sMJT1WHM/fUfcqli1NfkyxSOjr8jlNTH4JNCGacb2neWuwMN4C4TFXqMR8BENkn+XrCV1FjrlW1mCxlLDilVypP/uqqq04KzJpVyJG6zZLd/0DeknSLN6sDGKdCvIdS+YpHEhUxoEuf6QizCs8PTXhnJiA="));
+		try {
+			DKIMVerifier.apply(pkr, new SignatureRecordImpl("v=1; a=dsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject:from:to:content-type;
bh=AbPsrGRdyVjM2e5ZZdhQA/aLe305f2bPvPRohUxrGjo=; b=ksNsfQJv20M9/Vf66sMJT1WHM/fUfcqli1NfkyxSOjr8jlNTH4JNCGacb2neWuwMN4C4TFXqMR8BENkn+XrCV1FjrlW1mCxlLDilVypP/uqqq04KzJpVyJG6zZLd/0DeknSLN6sDGKdCvIdS+YpHEhUxoEuf6QizCs8PTXhnJiA="));
+			fail("This is not a signature for that key");
+		} catch (IllegalStateException e) {
+		}
+		pkr = new PublicKeyRecordImpl("k=rsa; t=y:s; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIhyR3oItOy22ZOaBrIVe9m/iME3RqOJeasANSpg2YTHTYV+Xtp4xwf5gTjCmHQEMOs0qYu0FYiNQPQogJ2t0Mfx9zNu06rfRBDjiIU9tpx2T+NGlWZ8qhbiLo5By8apJavLyqTLavyPSrvsx0B3YzC63T4Age2CDqZYA+OwSMWQIDAQAB");
+		pkr.validate();
+		DKIMVerifier.apply(pkr, new SignatureRecordImpl("v=1; a=rsa-sha256; c=relaxed/relaxed;
i=test@gmail.com; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject:from:to:content-type;
bh=AbPsrGRdyVjM2e5ZZdhQA/aLe305f2bPvPRohUxrGjo=; b=ksNsfQJv20M9/Vf66sMJT1WHM/fUfcqli1NfkyxSOjr8jlNTH4JNCGacb2neWuwMN4C4TFXqMR8BENkn+XrCV1FjrlW1mCxlLDilVypP/uqqq04KzJpVyJG6zZLd/0DeknSLN6sDGKdCvIdS+YpHEhUxoEuf6QizCs8PTXhnJiA="));
+		try {
+			DKIMVerifier.apply(pkr, new SignatureRecordImpl("v=1; a=rsa-sha256; c=relaxed/relaxed;
i=test@subdomain.gmail.com; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject:from:to:content-type;
bh=AbPsrGRdyVjM2e5ZZdhQA/aLe305f2bPvPRohUxrGjo=; b=ksNsfQJv20M9/Vf66sMJT1WHM/fUfcqli1NfkyxSOjr8jlNTH4JNCGacb2neWuwMN4C4TFXqMR8BENkn+XrCV1FjrlW1mCxlLDilVypP/uqqq04KzJpVyJG6zZLd/0DeknSLN6sDGKdCvIdS+YpHEhUxoEuf6QizCs8PTXhnJiA="));
+			fail("This is not a signature for that key");
+		} catch (IllegalStateException e) {
+		}
+		pkr = new PublicKeyRecordImpl("k=rsa; g=test*; t=y; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIhyR3oItOy22ZOaBrIVe9m/iME3RqOJeasANSpg2YTHTYV+Xtp4xwf5gTjCmHQEMOs0qYu0FYiNQPQogJ2t0Mfx9zNu06rfRBDjiIU9tpx2T+NGlWZ8qhbiLo5By8apJavLyqTLavyPSrvsx0B3YzC63T4Age2CDqZYA+OwSMWQIDAQAB");
+		pkr.validate();
+		DKIMVerifier.apply(pkr, new SignatureRecordImpl("v=1; a=rsa-sha256; c=relaxed/relaxed;
i=test@gmail.com; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject:from:to:content-type;
bh=AbPsrGRdyVjM2e5ZZdhQA/aLe305f2bPvPRohUxrGjo=; b=ksNsfQJv20M9/Vf66sMJT1WHM/fUfcqli1NfkyxSOjr8jlNTH4JNCGacb2neWuwMN4C4TFXqMR8BENkn+XrCV1FjrlW1mCxlLDilVypP/uqqq04KzJpVyJG6zZLd/0DeknSLN6sDGKdCvIdS+YpHEhUxoEuf6QizCs8PTXhnJiA="));
+		try {
+			DKIMVerifier.apply(pkr, new SignatureRecordImpl("v=1; a=rsa-sha256; c=relaxed/relaxed;
i=bad@subdomain.gmail.com; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject:from:to:content-type;
bh=AbPsrGRdyVjM2e5ZZdhQA/aLe305f2bPvPRohUxrGjo=; b=ksNsfQJv20M9/Vf66sMJT1WHM/fUfcqli1NfkyxSOjr8jlNTH4JNCGacb2neWuwMN4C4TFXqMR8BENkn+XrCV1FjrlW1mCxlLDilVypP/uqqq04KzJpVyJG6zZLd/0DeknSLN6sDGKdCvIdS+YpHEhUxoEuf6QizCs8PTXhnJiA="));
+			fail("This is not a signature for that key");
+		} catch (IllegalStateException e) {
+		}
+		pkr = new PublicKeyRecordImpl("k=rsa; g=test*; t=y; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIhyR3oItOy22ZOaBrIVe9m/iME3RqOJeasANSpg2YTHTYV+Xtp4xwf5gTjCmHQEMOs0qYu0FYiNQPQogJ2t0Mfx9zNu06rfRBDjiIU9tpx2T+NGlWZ8qhbiLo5By8apJavLyqTLavyPSrvsx0B3YzC63T4Age2CDqZYA+OwSMWQIDAQAB");
+		pkr.validate();
+
+		pkr = new PublicKeyRecordImpl("k=rsa; h=sha1; t=y; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIhyR3oItOy22ZOaBrIVe9m/iME3RqOJeasANSpg2YTHTYV+Xtp4xwf5gTjCmHQEMOs0qYu0FYiNQPQogJ2t0Mfx9zNu06rfRBDjiIU9tpx2T+NGlWZ8qhbiLo5By8apJavLyqTLavyPSrvsx0B3YzC63T4Age2CDqZYA+OwSMWQIDAQAB");
+		pkr.validate();
+		try {
+			DKIMVerifier.apply(pkr, new SignatureRecordImpl("v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject:from:to:content-type;
bh=AbPsrGRdyVjM2e5ZZdhQA/aLe305f2bPvPRohUxrGjo=; b=ksNsfQJv20M9/Vf66sMJT1WHM/fUfcqli1NfkyxSOjr8jlNTH4JNCGacb2neWuwMN4C4TFXqMR8BENkn+XrCV1FjrlW1mCxlLDilVypP/uqqq04KzJpVyJG6zZLd/0DeknSLN6sDGKdCvIdS+YpHEhUxoEuf6QizCs8PTXhnJiA="));
+			fail("This hash method is not supported for that publick key");
+		} catch (IllegalStateException e) {
+		}
+	}
+
+
+}

Propchange: james/jdkim/trunk/main/src/test/java/org/apache/james/jdkim/DKIMVerifierTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: james/jdkim/trunk/main/src/test/java/org/apache/james/jdkim/DKIMVerifierTest.java
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: james/jdkim/trunk/main/src/test/java/org/apache/james/jdkim/PublicKeyRecordTest.java
URL: http://svn.apache.org/viewvc/james/jdkim/trunk/main/src/test/java/org/apache/james/jdkim/PublicKeyRecordTest.java?rev=823845&r1=823844&r2=823845&view=diff
==============================================================================
--- james/jdkim/trunk/main/src/test/java/org/apache/james/jdkim/PublicKeyRecordTest.java (original)
+++ james/jdkim/trunk/main/src/test/java/org/apache/james/jdkim/PublicKeyRecordTest.java Sat
Oct 10 11:53:34 2009
@@ -26,7 +26,6 @@
 import java.util.regex.Pattern;
 
 import org.apache.james.jdkim.tagvalue.PublicKeyRecordImpl;
-import org.apache.james.jdkim.tagvalue.SignatureRecordImpl;
 
 import junit.framework.TestCase;
 
@@ -184,43 +183,6 @@
 		}
 	}
 
-	public void testApply() {
-		PublicKeyRecord pkr = new PublicKeyRecordImpl("k=rsa; t=y; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIhyR3oItOy22ZOaBrIVe9m/iME3RqOJeasANSpg2YTHTYV+Xtp4xwf5gTjCmHQEMOs0qYu0FYiNQPQogJ2t0Mfx9zNu06rfRBDjiIU9tpx2T+NGlWZ8qhbiLo5By8apJavLyqTLavyPSrvsx0B3YzC63T4Age2CDqZYA+OwSMWQIDAQAB");
-		pkr.validate();
-		pkr.apply(new SignatureRecordImpl("v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma;
h=domainkey-signature:mime-version:received:date:message-id:subject:from:to:content-type;
bh=AbPsrGRdyVjM2e5ZZdhQA/aLe305f2bPvPRohUxrGjo=; b=ksNsfQJv20M9/Vf66sMJT1WHM/fUfcqli1NfkyxSOjr8jlNTH4JNCGacb2neWuwMN4C4TFXqMR8BENkn+XrCV1FjrlW1mCxlLDilVypP/uqqq04KzJpVyJG6zZLd/0DeknSLN6sDGKdCvIdS+YpHEhUxoEuf6QizCs8PTXhnJiA="));
-		try {
-			pkr.apply(new SignatureRecordImpl("v=1; a=dsa-sha256; c=relaxed/relaxed; d=gmail.com;
s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject:from:to:content-type;
bh=AbPsrGRdyVjM2e5ZZdhQA/aLe305f2bPvPRohUxrGjo=; b=ksNsfQJv20M9/Vf66sMJT1WHM/fUfcqli1NfkyxSOjr8jlNTH4JNCGacb2neWuwMN4C4TFXqMR8BENkn+XrCV1FjrlW1mCxlLDilVypP/uqqq04KzJpVyJG6zZLd/0DeknSLN6sDGKdCvIdS+YpHEhUxoEuf6QizCs8PTXhnJiA="));
-			fail("This is not a signature for that key");
-		} catch (IllegalStateException e) {
-		}
-		pkr = new PublicKeyRecordImpl("k=rsa; t=y:s; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIhyR3oItOy22ZOaBrIVe9m/iME3RqOJeasANSpg2YTHTYV+Xtp4xwf5gTjCmHQEMOs0qYu0FYiNQPQogJ2t0Mfx9zNu06rfRBDjiIU9tpx2T+NGlWZ8qhbiLo5By8apJavLyqTLavyPSrvsx0B3YzC63T4Age2CDqZYA+OwSMWQIDAQAB");
-		pkr.validate();
-		pkr.apply(new SignatureRecordImpl("v=1; a=rsa-sha256; c=relaxed/relaxed; i=test@gmail.com;
d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject:from:to:content-type;
bh=AbPsrGRdyVjM2e5ZZdhQA/aLe305f2bPvPRohUxrGjo=; b=ksNsfQJv20M9/Vf66sMJT1WHM/fUfcqli1NfkyxSOjr8jlNTH4JNCGacb2neWuwMN4C4TFXqMR8BENkn+XrCV1FjrlW1mCxlLDilVypP/uqqq04KzJpVyJG6zZLd/0DeknSLN6sDGKdCvIdS+YpHEhUxoEuf6QizCs8PTXhnJiA="));
-		try {
-			pkr.apply(new SignatureRecordImpl("v=1; a=rsa-sha256; c=relaxed/relaxed; i=test@subdomain.gmail.com;
d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject:from:to:content-type;
bh=AbPsrGRdyVjM2e5ZZdhQA/aLe305f2bPvPRohUxrGjo=; b=ksNsfQJv20M9/Vf66sMJT1WHM/fUfcqli1NfkyxSOjr8jlNTH4JNCGacb2neWuwMN4C4TFXqMR8BENkn+XrCV1FjrlW1mCxlLDilVypP/uqqq04KzJpVyJG6zZLd/0DeknSLN6sDGKdCvIdS+YpHEhUxoEuf6QizCs8PTXhnJiA="));
-			fail("This is not a signature for that key");
-		} catch (IllegalStateException e) {
-		}
-		pkr = new PublicKeyRecordImpl("k=rsa; g=test*; t=y; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIhyR3oItOy22ZOaBrIVe9m/iME3RqOJeasANSpg2YTHTYV+Xtp4xwf5gTjCmHQEMOs0qYu0FYiNQPQogJ2t0Mfx9zNu06rfRBDjiIU9tpx2T+NGlWZ8qhbiLo5By8apJavLyqTLavyPSrvsx0B3YzC63T4Age2CDqZYA+OwSMWQIDAQAB");
-		pkr.validate();
-		pkr.apply(new SignatureRecordImpl("v=1; a=rsa-sha256; c=relaxed/relaxed; i=test@gmail.com;
d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject:from:to:content-type;
bh=AbPsrGRdyVjM2e5ZZdhQA/aLe305f2bPvPRohUxrGjo=; b=ksNsfQJv20M9/Vf66sMJT1WHM/fUfcqli1NfkyxSOjr8jlNTH4JNCGacb2neWuwMN4C4TFXqMR8BENkn+XrCV1FjrlW1mCxlLDilVypP/uqqq04KzJpVyJG6zZLd/0DeknSLN6sDGKdCvIdS+YpHEhUxoEuf6QizCs8PTXhnJiA="));
-		try {
-			pkr.apply(new SignatureRecordImpl("v=1; a=rsa-sha256; c=relaxed/relaxed; i=bad@subdomain.gmail.com;
d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject:from:to:content-type;
bh=AbPsrGRdyVjM2e5ZZdhQA/aLe305f2bPvPRohUxrGjo=; b=ksNsfQJv20M9/Vf66sMJT1WHM/fUfcqli1NfkyxSOjr8jlNTH4JNCGacb2neWuwMN4C4TFXqMR8BENkn+XrCV1FjrlW1mCxlLDilVypP/uqqq04KzJpVyJG6zZLd/0DeknSLN6sDGKdCvIdS+YpHEhUxoEuf6QizCs8PTXhnJiA="));
-			fail("This is not a signature for that key");
-		} catch (IllegalStateException e) {
-		}
-		pkr = new PublicKeyRecordImpl("k=rsa; g=test*; t=y; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIhyR3oItOy22ZOaBrIVe9m/iME3RqOJeasANSpg2YTHTYV+Xtp4xwf5gTjCmHQEMOs0qYu0FYiNQPQogJ2t0Mfx9zNu06rfRBDjiIU9tpx2T+NGlWZ8qhbiLo5By8apJavLyqTLavyPSrvsx0B3YzC63T4Age2CDqZYA+OwSMWQIDAQAB");
-		pkr.validate();
-
-		pkr = new PublicKeyRecordImpl("k=rsa; h=sha1; t=y; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIhyR3oItOy22ZOaBrIVe9m/iME3RqOJeasANSpg2YTHTYV+Xtp4xwf5gTjCmHQEMOs0qYu0FYiNQPQogJ2t0Mfx9zNu06rfRBDjiIU9tpx2T+NGlWZ8qhbiLo5By8apJavLyqTLavyPSrvsx0B3YzC63T4Age2CDqZYA+OwSMWQIDAQAB");
-		pkr.validate();
-		try {
-			pkr.apply(new SignatureRecordImpl("v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com;
s=gamma; h=domainkey-signature:mime-version:received:date:message-id:subject:from:to:content-type;
bh=AbPsrGRdyVjM2e5ZZdhQA/aLe305f2bPvPRohUxrGjo=; b=ksNsfQJv20M9/Vf66sMJT1WHM/fUfcqli1NfkyxSOjr8jlNTH4JNCGacb2neWuwMN4C4TFXqMR8BENkn+XrCV1FjrlW1mCxlLDilVypP/uqqq04KzJpVyJG6zZLd/0DeknSLN6sDGKdCvIdS+YpHEhUxoEuf6QizCs8PTXhnJiA="));
-			fail("This hash method is not supported for that publick key");
-		} catch (IllegalStateException e) {
-		}
-	}
-
 	public void testGetFlags() {
 		PublicKeyRecord pkr = new PublicKeyRecordImpl("k=rsa; t=y:s; p=MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDIhyR3oItOy22ZOaBrIVe9m/iME3RqOJeasANSpg2YTHTYV+Xtp4xwf5gTjCmHQEMOs0qYu0FYiNQPQogJ2t0Mfx9zNu06rfRBDjiIU9tpx2T+NGlWZ8qhbiLo5By8apJavLyqTLavyPSrvsx0B3YzC63T4Age2CDqZYA+OwSMWQIDAQAB");
 		pkr.validate();



---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message