cancel
Showing results for 
Search instead for 
Did you mean: 

OpenPGP encryption using bouncycastle in XI

Former Member
0 Kudos

Hi All,

I am trying to encrypt IDOC flat files with PGP encryption before ftp them to a remote server. I am using bouncycastle libraries. I tested outside XI using their sample programs. Everything works fine. But when I deploy to XI, I receive the following error messages:

"The provider BC may not be signed by a trusted party"

I tried with two different ways in XI:

1. Using Java mapping - this is not a standard approach. First, I have an ABAP map to convert the IDOC from XML to flat file. Then use the second Java map to encrypt the content. With this approach, I need to import the bouncycastle libraries into "Imported Archives". I think XI actually unpack the jar files during the import process. So it did modify the signed jar files from boucycastle. This error message makes a lot of sense.

2. Using adapter module - this is the recommended approach. I developed a module EAR and bundled the libraries and deployed to XI using NWDS SDM. But I still got the same error. I am going to try again with visual administrator and see if that will make any difference.

I am running out of ideas. Does anyone have successful experience using bouncycastle within XI? Any help is greatly appreciated.

Thanks in advance!

Kenny

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi folks!

Kenny, did you solve this?

How have your approch been?

(could you acutally write the steps in here so that folks like me can understand what to do!)

Is it even possible to paste the code you are using for this? I am right trying to do the same thing but I am not 100% sure on the Java coding.

I need to PGP encrypt a flatfile, and then FTP the file to another system. Seems pretty much to be a perfect match for what you have done!

Thanks in advance.

Mattias Kardell

Former Member
0 Kudos

Mattias,

No, I haven't got a chance to spend more time on this since this requirement has been postponed. But I think this should be a classloader problem. I will try to deploy the libraries in XI's JAVA_HOME\lib\ext folder and see if that makes any difference. Since I need help from Basis to do this, it is a little inconvenient.

I don't have the source code with me right now. But you should take a look at bouncycastle's sample code. It demonstrates the API usage pretty clearly. You should be able to slightly modify it to make it run inside an adapter module. If you still have trouble, let me know. I can post the code later.

Cheers,

Kenny

ravi_raman2
Active Contributor
0 Kudos

Matias,

I have actually done this, its pretty straight, Create your adapter module, get your data, Encrypt it send it outward, using sftp..there are some open source libraries for this......

in ward..recieve decrypt send in........

Regards

Ravi Raman

Former Member
0 Kudos

Ravi,

Do you also use bouncycastle? Did you have the same problem as I did? Did you include the libraries in the ear file? Can you share your solution?

Thanks!

Kenny

Former Member
0 Kudos

Hey

Even i agree with you that developing adapter module is the best way,but due to some constraints,we ended up using OS command to execute a script and do PgP encryption.

Thanx

Aamir