|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectbadpenguin.dkim.Signer
public class Signer
The Signer class implements the necessary methods to create a DKIM or DomainKey signature header for a given message. It tries to be compliant with version 1 of the DKIM specification. See: http://www.ietf.org/rfc/rfc4871.txt
Constructor Summary | |
---|---|
Signer(DkimSignature DKIMSig,
java.security.PrivateKey key)
Create a Signer object using the specified DkimSignature object, and the PrivateKey. |
|
Signer(java.lang.String selector,
java.lang.String domain,
java.lang.String alg,
java.security.PrivateKey key)
Creates a Signer object using the specified Domain, Selector and PrivateKey. |
|
Signer(java.lang.String selector,
java.lang.String domain,
java.lang.String headers,
java.lang.String alg,
java.security.PrivateKey key)
Creates a Signer object using the specified Domain, Selector, Algorithm and PrivateKey. |
Method Summary | |
---|---|
java.lang.String[] |
getAdditionalHeaders()
Get the current additional headers, which will appended to the H tag, and included in the signature. |
boolean |
getAutoHeaders()
Get the current autoHeaders setting for this Signer. |
boolean |
getAutoTimeStamp()
Get the current setting for autoTimeStamp. |
DkimSignature |
getDkimSignature()
Get the DkimSignature object in use by this Signer. |
int |
getExpireSeconds()
Get the current value of the Expire Seconds. |
void |
setAdditionalHeaders(java.lang.String[] headers)
This method allows you to append extra headers to the ones generated by autoheaders, and should be used in place of the DkimSignature equivalents when the Signer has autoHeaders switched on. |
void |
setAutoExpire(boolean autoExpire)
Set whether the signature should automatically calculate an expiration tag. |
void |
setAutoHeaders(boolean autoHeaders)
If autoHeaders is on (true), then we will ask the canoncialiser to provide us with the list of headers present in the message, and recommended by the RFC. |
void |
setAutoTimeStamp(boolean autoTimeStamp)
Switch time stamp generation on or off. |
void |
setExpireSeconds(int seconds)
Set the number of seconds the DkimSignature will be valid for. |
java.lang.String |
signMail(java.io.InputStream msg)
Generate a DKIM-Signature header for the provided mail message. |
void |
signMail(java.io.InputStream msg,
java.io.OutputStream out)
Process the incoming email from the InputStream msg and return a DKIM-Signed copy of the email in the OutputStream out. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Signer(java.lang.String selector, java.lang.String domain, java.lang.String headers, java.lang.String alg, java.security.PrivateKey key) throws DkimException
selector
- - The selector for this DKIM headerdomain
- - The domain name for this DKIM headerheaders
- - A colon separated list of headers to signalg
- - The hashing Algorithm to be used, rsa-sha256 or rsa-sha1key
- - The PrivateKey (which matches the public one found in DNS).
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
DkimException
public Signer(java.lang.String selector, java.lang.String domain, java.lang.String alg, java.security.PrivateKey key) throws DkimException
selector
- - The selector for this DKIM headerdomain
- - The domain name for this DKIM headeralg
- - The hashing Algorithm to be used, rsa-sha256 or rsa-sha1key
- - The PrivateKey (which matches the public one found in DNS).
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
DkimException
public Signer(DkimSignature DKIMSig, java.security.PrivateKey key) throws DkimException
DKIMSig
- key
-
java.security.NoSuchAlgorithmException
java.security.InvalidKeyException
DkimException
Method Detail |
---|
public void setAutoHeaders(boolean autoHeaders)
autoHeaders
- public boolean getAutoHeaders()
public void setAdditionalHeaders(java.lang.String[] headers)
headers
- public java.lang.String[] getAdditionalHeaders()
public void setExpireSeconds(int seconds)
seconds
- public int getExpireSeconds()
public void setAutoTimeStamp(boolean autoTimeStamp)
autoTimeStamp
- public boolean getAutoTimeStamp()
public void setAutoExpire(boolean autoExpire)
autoExpire
- on/offpublic DkimSignature getDkimSignature()
public java.lang.String signMail(java.io.InputStream msg) throws DkimException
msg
- - The raw email message (headers + body)
DkimException
public void signMail(java.io.InputStream msg, java.io.OutputStream out) throws DkimException
msg
- - The incoming messageout
- - An output stream to write the signed message to
DkimException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |