org.apache.james.jdkim
Class DKIMVerifier

java.lang.Object
  extended by org.apache.james.jdkim.DKIMCommon
      extended by org.apache.james.jdkim.DKIMVerifier

public class DKIMVerifier
extends DKIMCommon


Constructor Summary
DKIMVerifier()
           
DKIMVerifier(PublicKeyRecordRetriever publicKeyRecordRetriever)
           
 
Method Summary
static void apply(PublicKeyRecord pkr, SignatureRecord sign)
          asserts applicability of a signature record the a public key record.
protected  PublicKeyRecordRetriever getPublicKeyRecordRetriever()
           
 BodyHasher newBodyHasher(SignatureRecord signRecord)
           
protected  PublicKeyRecord newPublicKeyRecord(String record)
           
 SignatureRecord newSignatureRecord(String record)
           
 PublicKeyRecord publicKeySelector(List records)
           
 PublicKeyRecord publicRecordLookup(SignatureRecord sign)
          Iterates through signature's declared lookup method
 List verify(Headers messageHeaders, InputStream bodyInputStream)
          Verifies all of the DKIM-Signature records declared in the Headers object.
 List verify(InputStream is)
          Verifies all of the DKIM-Signature records declared in the supplied input stream
 
Methods inherited from class org.apache.james.jdkim.DKIMCommon
signatureCheck, streamCopy, updateSignature
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DKIMVerifier

public DKIMVerifier()

DKIMVerifier

public DKIMVerifier(PublicKeyRecordRetriever publicKeyRecordRetriever)
Method Detail

newPublicKeyRecord

protected PublicKeyRecord newPublicKeyRecord(String record)

newSignatureRecord

public SignatureRecord newSignatureRecord(String record)

newBodyHasher

public BodyHasher newBodyHasher(SignatureRecord signRecord)
                         throws PermFailException
Throws:
PermFailException

getPublicKeyRecordRetriever

protected PublicKeyRecordRetriever getPublicKeyRecordRetriever()
                                                        throws PermFailException
Throws:
PermFailException

publicKeySelector

public PublicKeyRecord publicKeySelector(List records)
                                  throws PermFailException
Throws:
PermFailException

apply

public static void apply(PublicKeyRecord pkr,
                         SignatureRecord sign)
                  throws PermFailException
asserts applicability of a signature record the a public key record. throws an

Parameters:
pkr - public key record
sign - signature record
Throws:
PermFailException - when the keys are not applicable

publicRecordLookup

public PublicKeyRecord publicRecordLookup(SignatureRecord sign)
                                   throws TempFailException,
                                          PermFailException
Iterates through signature's declared lookup method

Parameters:
sign - the signature record
Returns:
an "applicable" PublicKeyRecord
Throws:
TempFailException
PermFailException

verify

public List verify(InputStream is)
            throws IOException,
                   FailException
Verifies all of the DKIM-Signature records declared in the supplied input stream

Parameters:
is - inputStream
Returns:
a list of verified signature records.
Throws:
IOException
FailException - if no signature can be verified

verify

public List verify(Headers messageHeaders,
                   InputStream bodyInputStream)
            throws IOException,
                   FailException
Verifies all of the DKIM-Signature records declared in the Headers object.

Parameters:
messageHeaders - parsed headers
bodyInputStream - input stream for the body.
Returns:
a list of verified signature records
Throws:
IOException
FailException - if no signature can be verified


Copyright © 2008-2009 The Apache Software Foundation. All Rights Reserved.