Package org.apache.james.jdkim
Class DKIMSignerImpl
java.lang.Object
org.apache.james.jdkim.DKIMCommon
org.apache.james.jdkim.DKIMSignerImpl
- All Implemented Interfaces:
DKIMSigner
- Direct Known Subclasses:
IscheduleDKIMSignerImpl
-
Field Summary
FieldsFields inherited from class org.apache.james.jdkim.DKIMCommon
deepDebug -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic PrivateKeygetPrivateKey(String privateKeyPKCS8) Generate a PrivateKey from a Base64 encoded private key.newBodyHasher(SignatureRecord signRecord) newSignatureRecordTemplate(String record) sign(InputStream is) sign(Headers message, BodyHasher bh) Methods inherited from class org.apache.james.jdkim.DKIMCommon
debugMsg, signatureCheck, streamCopy, trace, updateSignature
-
Field Details
-
privateKey
-
signatureRecordTemplate
-
-
Constructor Details
-
DKIMSignerImpl
-
-
Method Details
-
newSignatureRecordTemplate
- Specified by:
newSignatureRecordTemplatein interfaceDKIMSigner
-
newBodyHasher
- Specified by:
newBodyHasherin interfaceDKIMSigner- Throws:
PermFailException
-
sign
- Specified by:
signin interfaceDKIMSigner- Throws:
IOExceptionFailException
-
sign
- Specified by:
signin interfaceDKIMSigner- Throws:
PermFailException
-
getPrivateKey
public static PrivateKey getPrivateKey(String privateKeyPKCS8) throws NoSuchAlgorithmException, InvalidKeySpecException Generate a PrivateKey from a Base64 encoded private key. In order to generate a valid PKCS8 key when you have a PEM key you can do this:openssl pkcs8 -topk8 -inform PEM -in rsapriv.pem -outform DER -nocrypt -out rsapriv.derAnd then base64 encode the content.- Parameters:
privateKeyPKCS8- a Base64 encoded string of the RSA key in PKCS8 format- Returns:
- the PrivateKey
- Throws:
NoSuchAlgorithmException- if RSA is unknownInvalidKeySpecException- on bad input key
-