on 12-18-2007 9:47 AM
Hi all,
I have a problem in a scenario where I have to generate a signature for a part of the xml data of a message. This signature has to be moved to a special tag within the document. Therefore I created a Java Mapping where I access the keystore of the J2EE Engine and generate the signature.
Part of the Implementation:
InitialContext context = new InitialContext(env);
manager = (KeystoreManager) context.lookup("keystore");
KeyStore keyStore = null;
keyStore = manager.getKeystore("DEFAULT");
SsfProfileKeyStore profile = null;
profile = new SsfProfileKeyStore(keyStore, alias, null);
PrivateKey key = profile.getPrivateKey();
Signature sig = Signature.getInstance("RSA");
sig.initSign(key);
sig.update(data);
signature = sig.sign();
When I create the InitialContext over remote and run it within the Developer Studio for example with file streams it works fine. But after import to the Integration Builder integration into an interface mapping, I get an Exception with this error:
javax.crypto.BadPaddingException: PKCS#1 requires data at least 11 bytes shorter than the modulus!
When I write the format of the key to the trace it is PKCS#8, as it should be.
Do someone has an idea where the runtime thinks it should handle the signature with PKCS#1?
Thanks
Regards
Olli
Hi Oliver,
Did you get solution to this problem. Please let me know if you have the solution. Thx
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.