on 08-08-2015 10:36 PM
Hi,
I'm testing with X.509 on SAP PI 7.4 SP08 , I could sign, verify, encrypt and decrypt values in a UDF.
I have copied and pasted the code in a module ( EJB 3.0 ) and is not working, below is the code to encrypt:
public byte[] encrypt(byte[] inpBytes, String keyStorageView, String keyStorageEntry,String SubjectDN) throws Exception {
KeyStore keyStore = null;
boolean res = false;
ByteArrayInputStream is = null;
SsfDataPKCS7 data = null;
byte[] result = null;
InitialContext ctx = null;
ctx = new InitialContext();
Object o = null;
o = ctx.lookup("keystore");
KeystoreManager manager = (KeystoreManager)o;
keyStore = manager.getKeystore(keyStorageView);//in debugging mode I see no certificates!
is = new ByteArrayInputStream(inpBytes);
data = new SsfDataPKCS7((InputStream)is);
SsfPabKeyStore profile;
profile = new SsfPabKeyStore(keyStore);
SsfSigRcpList test = new SsfSigRcpList();
test.add(new SsfSigRcpInfo(profile.getCertificateBySubjectDN(SubjectDN)));//null value in "profile.getCertificateBySubjectDN(SubjectDN)"
res = data.encrypt(test,(ISsfPab)profile);
if (res) {
result = (byte[])data.getDataPKCS7();
}
return result;
}
Any ideas?.(I think it's a bug).
Best regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
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.