org.apache.james.jdkim
Class DKIMVerifier
java.lang.Object
org.apache.james.jdkim.DKIMCommon
org.apache.james.jdkim.DKIMVerifier
public class DKIMVerifier
- extends DKIMCommon
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
DKIMVerifier
public DKIMVerifier()
DKIMVerifier
public DKIMVerifier(PublicKeyRecordRetriever publicKeyRecordRetriever)
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 recordsign
- 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 headersbodyInputStream
- 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.