cancel
Showing results for 
Search instead for 
Did you mean: 

Sending Digitally signed emails in Webdynpro

Former Member
0 Kudos

Hi,

Presently I am using Java mail api for sending emails in webdynpro. But now I also need to digitally sign the emails. I tried the following code

ISsfData data = null;

SsfProfileKeyStore profile =null;

boolean res=false;

data = new SsfDataSMIME(message,session); // "message" contains the entire email content

InitialContext ctx = new InitialContext();

Object o = (Object) ctx.lookup("keystore");

KeystoreManager manager = (KeystoreManager) o;

KeyStore keyStore = manager.getKeystore("DEFAULT");

String alias = "test";

profile = new SsfProfileKeyStore(keyStore, alias, null);

// sign the data

SsfDataSMIME data2=(SsfDataSMIME)data;

res = data2.sign(profile);

On executing this code the problem that I face is that the email is not getting signed and variable res remains false, whereas if I change the SsfDataSMIME(message, session) constructor to SsfDataXML(inputStream) then the above piece of code works fine and I am able to sign any XML file.

Can anyone tell me whats the mistake that I am doing and also suggest what all needs to be done for sending a digitally signed email.

Best Regards,

Harshit

Edited by: Harshit Madania on Jul 29, 2008 8:20 AM

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Harshit,

I hope this link might be helpful for Sending Digitally Signed Emails.

[https://www.sdn.sap.com/irj/sdn/go/portal/prtroot/docs/library/uuid/7149de90-0201-0010-0689-afa2ac5d2048]

Regards,

Sharma.

0 Kudos

Harshit,

The primary difference between SsfDataSMIME and SsfDataXML is in constructors. I believe that 'message' and 'session' parameters that are being used to construct SsfDataSMIME object contain the appropriate values and you are catching the errors appropriately.

Apart from that everything else seems correct to me. For further help, try the link below.

[This post may be helpful to you.|;

Regards,

Vishwas.