on 07-29-2008 3:49 AM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.