public class DKIMSigner extends DKIMCommon
deepDebug
Constructor and Description |
---|
DKIMSigner(String signatureRecordTemplate,
PrivateKey privateKey) |
Modifier and Type | Method and Description |
---|---|
static PrivateKey |
getPrivateKey(String privateKeyPKCS8)
Generate a PrivateKey from a Base64 encoded private key.
|
BodyHasher |
newBodyHasher(SignatureRecord signRecord) |
SignatureRecord |
newSignatureRecordTemplate(String record) |
String |
sign(Headers message,
BodyHasher bh) |
String |
sign(InputStream is) |
debugMsg, signatureCheck, streamCopy, trace, updateSignature
public DKIMSigner(String signatureRecordTemplate, PrivateKey privateKey)
public SignatureRecord newSignatureRecordTemplate(String record)
public BodyHasher newBodyHasher(SignatureRecord signRecord) throws PermFailException
PermFailException
public String sign(InputStream is) throws IOException, FailException
IOException
FailException
public String sign(Headers message, BodyHasher bh) throws PermFailException
PermFailException
public static PrivateKey getPrivateKey(String privateKeyPKCS8) throws NoSuchAlgorithmException, InvalidKeySpecException
openssl pkcs8 -topk8 -inform PEM -in rsapriv.pem -outform DER -nocrypt -out rsapriv.der
And then base64 encode the content.privateKeyPKCS8
- a Base64 encoded string of the RSA key in PKCS8 formatNoSuchAlgorithmException
- if RSA is unknownInvalidKeySpecException
- on bad input keyCopyright © 2008–2015. All rights reserved.