public class DKIMVerifier extends DKIMCommon
Modifier and Type | Field and Description |
---|---|
protected int |
allowableFutureSeconds |
deepDebug
Constructor and Description |
---|
DKIMVerifier() |
DKIMVerifier(PublicKeyRecordRetriever publicKeyRecordRetriever) |
Modifier and Type | Method and Description |
---|---|
static void |
addStoredKey(String domain,
String selector,
String key)
Save a stored key for private-exchange
|
static void |
apply(PublicKeyRecord pkr,
SignatureRecord sign)
asserts applicability of a signature record the a public key record.
|
static void |
clearStoredKeys()
Clear any keys stored for private-exchange
|
protected PublicKeyRecordRetriever |
getPublicKeyRecordRetriever() |
BodyHasher |
newBodyHasher(Headers messageHeaders) |
protected BodyHasherImpl |
newBodyHasher(SignatureRecord signRecord) |
protected PublicKeyRecord |
newPublicKeyRecord(String record) |
SignatureRecord |
newSignatureRecord(String record) |
PublicKeyRecord |
publicKeySelector(List<String> records) |
PublicKeyRecord |
publicRecordLookup(SignatureRecord sign)
Iterates through signature's declared lookup method
|
List<SignatureRecord> |
verify(BodyHasher bh)
Completes the simultaneous verification of multiple
signatures given the previously prepared compound body hasher where
the user already written the body to the outputstream and closed it.
|
List<SignatureRecord> |
verify(Headers messageHeaders,
InputStream bodyInputStream)
Verifies all of the DKIM-Signature records declared in the Headers
object.
|
List<SignatureRecord> |
verify(InputStream is)
Verifies all of the DKIM-Signature records declared in the supplied input
stream
|
debugMsg, signatureCheck, streamCopy, trace, updateSignature
public DKIMVerifier()
public DKIMVerifier(PublicKeyRecordRetriever publicKeyRecordRetriever)
public static void clearStoredKeys()
public static void addStoredKey(String domain, String selector, String key)
domain
- as per specselector
- as per speckey
- as per specprotected PublicKeyRecord newPublicKeyRecord(String record)
public SignatureRecord newSignatureRecord(String record)
protected BodyHasherImpl newBodyHasher(SignatureRecord signRecord) throws PermFailException
PermFailException
protected PublicKeyRecordRetriever getPublicKeyRecordRetriever() throws PermFailException
PermFailException
public PublicKeyRecord publicKeySelector(List<String> records) throws PermFailException
PermFailException
public static void apply(PublicKeyRecord pkr, SignatureRecord sign) throws PermFailException
pkr
- public key recordsign
- signature recordPermFailException
- when the keys are not applicablepublic PublicKeyRecord publicRecordLookup(SignatureRecord sign) throws TempFailException, PermFailException
sign
- the signature recordTempFailException
- on errorPermFailException
- on errorpublic List<SignatureRecord> verify(InputStream is) throws IOException, FailException
is
- inputStreamIOException
- if errorFailException
- if no signature can be verifiedpublic BodyHasher newBodyHasher(Headers messageHeaders) throws FailException
FailException
public List<SignatureRecord> verify(Headers messageHeaders, InputStream bodyInputStream) throws IOException, FailException
messageHeaders
- parsed headersbodyInputStream
- input stream for the body.IOException
- on io errorFailException
- if no signature can be verifiedpublic List<SignatureRecord> verify(BodyHasher bh) throws FailException
bh
- the BodyHasher previously obtained by this class.FailException
- if no valid signature is foundCopyright © 2008–2015. All rights reserved.