cancel
Showing results for 
Search instead for 
Did you mean: 

Failure in signing Data

Former Member
0 Kudos

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

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Oliver,

Did you get solution to this problem. Please let me know if you have the solution. Thx