BouncyCastle PGP ????

Hi!
I am working on a project that requires PGP encryption / decryption. I have downloaded the BouncyCastle PGP libraries version 1.33. I am trying to run the AllTests application in the test folder but I am getting the following error when it is calling PgPKeyRingTest -> Test2 -> k.extractPrivateKey(sec2pass1, "BC").
1) testPGP(org.bouncycastle.openpgp.test.AllTests)junit.framework.AssertionFailedError: PGPKeyRingTest: exception: java.security.InvalidKeyException: Illegal key size
     at org.bouncycastle.openpgp.test.AllTests.testPGP(AllTests.java:25)
     at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
     at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
     at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
     at org.bouncycastle.openpgp.test.AllTests.main(AllTests.java:32)
I am running Windows XP and using Java jdk1.5.0_06, jce_policy-1_5_0.
Does anyone have any ideas what the problem might be?
Thanks,
Scott.
Message was edited by:
sdever98

Hi RDS,
Please can you tell me if you found the solution to this?
Best regards,
Luke

Similar Messages

  • PGP error in PI 7.4 - BouncyCastle Provider not found

    Hi ,
    I am working on PGP encryption in SAP PI7.4 .
    I have followed below link :
    PGPEncryption Module: A Simple How to Guide
    Using PGP in Process Integration
    But while doing end to end scenario it is givingg error :
    Exception caught by adapter framework: Could not process message, BouncyCastle Provider not found (java.security.NoSuchProviderException: unable to find provider.)
    In my sandbox it was woking fine but when trying to do the same thing in Dev box it staretd giving error .
    Can somebody help me .
    Thanks ,
    Anurag

    Hi Anurag
    You should check if the Secure Connectivity add on was deployed correctly in your Dev system. Maybe there are some missing JAR or SCA files.
    Refer to the Secure connectivity add-on installation guide on how to download and deploy the SCA files. You can find this guide on the Service Marketplace (search for PI SFTP PGP ADDON.)
    You can also refer to the following How-to guide on checking the installation via NWA. The guide is for SFTP but you can follow the same steps in page 2 to check.
    How To Configure SFTP Adapter in SAP PI
    Rgds
    Eng Swee

  • OpenPGP encryption using bouncycastle in XI

    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

    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

  • Linux script for PGP encryption

    Hello,
    We are trying to do PGP encryption by giving the OS command in the File adapter. Can somebody provide me the exact linux script that we should use to do PGP encryption?
    Note: We have XI-3.0 on LINUX.
    Promise points for helpful answers.
    Regards,
    Raji.

    Hi Rajashree
    PGP Encryption is used to support the transmission of sensitive data to / from third party systems via XI.
    Adapter modules are developed to encrypt the file using PGP.
    We had a similar requirement where we used PGP encryption.The module was developed using Cryptix OpenPGP which is a Java implementation of the OpenPGP standard.When the module is called in the adapter, it uses the PGP key provided by the party that will receive the encrypted message. This module should be called prior to calling the Sap adapter
    Logic Flow/Processing:
    1.Read the XML payload and message for getting the needed data.
    2.Read the key to be used in the encryption and log the key to be used and the beginning of the encryption.
    3.Call the PGP encryption and compression method.
    4.Log whether encryption has been successful.
    5.Set as payload the message content encrypted, and the principal data.
    6.If any error occurs, logs an exception in PGP adapter module and the error reason.
    7.Return the message.
    Go through This links
    Is there any FTP API available from SAP?
    Send Text file to FTP in binary mode with PGP encryption
    http://www.webmethods.com/meta/default/folder/0000007429
    Converting IDOC to XML
    XI implementation
    http://www1.webmethods.com/PDF/webMethods_for_SAP-wp.pdf
    Current versions found at http://www.cryptix.org and http://www.bouncycastle.org.
    http://www.bouncycastle.org/documentation.html
    If you want to use the unix script on windows then you need cygwin. Take the shell executable and cygwin.dll and copy them to another machine and try out.
    Else you write an .exe or a batch file where you will give your PGP command to encrypt and decrypt and execute it from the OS level in your adapter. Check my answer in this thread:
    Re: PGP Encription
    Might be useful.
    PGP Encription
    Re: PGP Encription
    \Re: triggering encryption script with XI
    Pls rewards if useful

  • Policy files expiry for pgp encryption

    HI All
    i am using bouncycastle jars for encrypting data using PGP.
    for this to function we need to install the jce unrestricted security files given at the java downloads
    but when i download and use them then for one weeek they are working fine
    but after one they an exception is raised like the below
    java.security.InvalidAlgorithmParameterException: parameter object not a DHParameterSpec or an ElGamalParameterSpec
    NOw i just copied the 2 jars(local_policy.jar,US_export_policy.jar) in the security directory of JDK to another name and again copied back to same name
    Its working fine
    NOw i am of the assumption that these jars expiry after certain days .Is it true????
    if so then do we have any way to make them permanent?
    how can we make these jars permanent??
    Is there any solution for this?
    Please anybody can help me as soon as possible
    Thanks
    vijay

    Hi,
    I have few questions to ask before i can provide you with the solution for this. We need to know what is the software that you are using for encryption, are you using APIs or using PGP software installed on the server and calling the executables to encrypt the file from the module?
    If you are using standard APIs it would be easier for traceability. There are standard code that is available which you can leverage for this purpose.
    Incase you are using PGP software some points to remember. You need to install the PGP software on the PI / XI server by logging in using SAPSERVICE<SID> username and password. If you install the software using SAPSERVICEADM it would not work. When you install it it creates folders and path for the software for that user. Infact when the server is running and the interfaces are working it would use the sapservice<SID>.
    For my current customer we have created a module to achieve the encryption / decryption of files. We have basically 5 parameters (this is according to the reqmt at our client end).
    Parameter 1: Operation: Values: Encryption / Decryption
    Parameter 2: username: Value: username which you want to pass (name of the vendor or the user code of the vendor).
    Parameter 3: Sign Value: Sign value(Some vendors want their files to be signed).
    Parameter 4: Armor: Value: Same as 4 (Another option commonly used).
    Parameter 5: Log:  Value: Y / N (Used for logging of messages for identifying problems in communication channel monitoring).
    Generate the PGP command depending on the values passed. (You can get the list of PGP commands from the software you are using or from the website (http://www.dsj.net/pgp/pgphelp.html).
    Trap all the error codes from the execution and raise exception so that the adapter errors out too.
    Let me know if you require any help regarding the same.
    Regards,
    Indranil
    Award Points if it was helpful.

  • Key store problem using bouncycastle

    Hey guys, i'm writing pseudo PGP encryption code using bouncycastle provider. Now everything works great when i start my project from NETBeans 6.8, but when i build .jar file,execute it and try to create a key store i get following message : "java.io.IOException: Error initialising store of key store : java.security.NoSuchProviderException: JCE cannot authenticate the provider BC" . Does anyone knows what might be the problem?

    Vaskea wrote:
    Hey guys, i'm writing pseudo PGP encryption code using bouncycastle provider. Now everything works great when i start my project from NETBeans 6.8, but when i build .jar file,execute it and try to create a key store i get following message : "java.io.IOException: Error initialising store of key store : java.security.NoSuchProviderException: JCE cannot authenticate the provider BC" . Does anyone knows what might be the problem?You probably have not included the BC JCE jar in your classpath!

  • Java PGP Code required

    Hi Guys,
    I need to develop an adapter module for SAP XI file adapter to use PGP (Pretty good privacy) encryption.
    I Need The Required Java Code.....

    didisoft_com wrote:
    In fact there is a pure java solution based on BouncyCastle, This advertisement is against section 1.2 of the [code of conduct|http://wikis.sun.com/display/SunForums/Sun+Forums+Code+of+Conduct] you agreed to when joining the forum.
    Message blocked.

  • How can i send PGP encrypted file from PI to the receiver

    Hi experts,
                        I am unable to send the  PGP encrypted file from PI to the receiver. where the Clients sends the file using PGP encryption,
    But i am trying to send the same with PI. But i am not able to send the same can you please help me out to get the same incorporated using PI 7.1
    and sends to the receiver ( the rceiver would be FTP ).
    Regards,
    Amruth

    hi,
    You can write an adapter module to encypt your payload before sending to Reciever:
    /people/dijesh.tanna/blog/2008/09/15/sap-pi-integrating-macafee-e-business-server-with-sap-pi-70-for-pgp-encryptiondecryption
    http://www.bouncycastle.org/documentation.html
    http://www.cryptix.org/
    http://aedaptive.com/index.php/solutions/pgp-for-sap-netweaver
    http://www.pgpi.org/doc/pgpintro/
    PGP encryption: Do we need to write adapter module?
    If you are getting PGP file from sender and want  to send this file to target without any mapping transformation you can use this blog:
    /people/william.li/blog/2006/09/08/how-to-send-any-data-even-binary-through-xi-without-using-the-integration-repository
    Thanks.

  • PGP decryption in Receiver Channel?

    Hi SAP Gurus,
    We have this HR interface that needs to be encrypted so the data will not be visible within PI monitoring tools.
    As solution, we are planning to use this PGP module to do the encryption and decryption.
    However as much as possible, we are trying to avoid doing the encryption/decryption on partners end (as main purpose is just to hide the data within PI).
    This is the scenario we have in mind:
    File to File scenario
    1) Partner sends the raw file
    2) PI receives the raw file and encrypts it using PGP encryption module and public key installed in PI.
    Sender Channel configuration (does the encryption):
    ENC    applyEncryption    true
    ENC    applySignature    false
    ENC    keyRootPath    C:\usr\sap\PI\keys
    ENC    partnerPublicKey    PIpub.asc
    3) Before PI sends the file which was encrypted earlier in PI, PI decrypts the file using PGP decryption module in the Receiver Communication Channel.
    Receiver Channel Configuration (does the decryption):
    DEC    keyRootPath    C:\usr\sap\PI\keys
    DEC    ownPrivateKey    PIprivate.asc
    DEC    partnerPublicKey    PIpub.asc
    DEC    pwdOwnPrivateKey    ***********
    I tried to test above scenario but I'm getting below error in the receiver communication channel..
    Error    Exception caught by adapter framework: org.bouncycastle.openpgp.PGPPublicKeyRing found where PGPSecretKeyRing expected
    Error    Transmitting the message to endpoint <local> using connection File_http://sap.com/xi/XI/System failed, due to: com.sap.engine.interfaces.messaging.api.exception.MessagingException: org.bouncycastle.openpgp.PGPException: org.bouncycastle.openpgp.PGPPublicKeyRing found where PGPSecretKeyRing expected
    Could you please confirm if above mentioned scenario is possible?
    And, what is the cause of the error?
    Thanks

    Hi,
    you can try like this,
    Encryption :
    1
    AF_Modules/MessageTransformBean
    Local Enterprise Bean
    3
    2
    AF_Modules/DynamicConfigurationBean
    Local Enterprise Bean
    2
    3
    localejbs/PGPEncryption
    Local Enterprise Bean
    1
    4
    CallSapAdapter
    Local Enterprise Bean
    0
    1  applyEncryption                     true
    1  encryptionAlgo                      AES_256
    1  keyRootPath                        XXXXXXX
      1  partnerPublicKey                XXXXXXXXX
      1  pwdOwnPrivateKey              ***
    Regards
    srinivas

  • PGP Issue

    Hi all,
    i am getting the following problem to use PGP encryption:
    Error Detail: org.bouncycastle.openpgp.PGPException: Exception creating cipher
    Caused by: java.security.InvalidKeyException: Illegal key size
         at javax.crypto.Cipher.a(DashoA13*..)
         at javax.crypto.Cipher.init(DashoA13*..)
         at javax.crypto.Cipher.init(DashoA13*..)
    in spite of we have jce unlimited policy installed 1.4.2 in the Pi server.
    Pls. give some recommendations to fix this problem.
    thanks in advance.
    Ivan

    Guys,
    In my local machine the PGP program runs fine, however in the server It is not working.
    I wonder if this differences could be the reason of the fail:
                                                                     Local Machine                                            Server
    Operative System                                  Windows XP   x32                                     Windows Server 2003  x64
    In both I installed the unlimited JCE.
    I hope You can help me on that.
    Thanks in advance
    Ivá

  • Which is the best Open source API  for PGP??

    Hi All,
    Please tell me
    which is the best Open source API for PGP??
    Please Help me thi is urgent!!
    regards
    harish

    I am also looking at these topic at the moment.
    I found Bouncycastle and hushSDK.
    Have you found a good one and with example also?

  • Implementation of PGP or GPG

    Hello World!
    I am looking to create one application in the java which has to encrypt the complete report through the client provided encryption key.
    I am searching into the forums and mostly found the "www.bouncycastle.org" and "www.cryptix.org" links. But I am not able to get the exact required data.If someone has implemented through these links can guide me which exact API I need to use? which class of the API will encypt?
    Or do we have anyother Java API for the encryption?
    Please guide.

    Let me give you more detail about what I want. I am provided by the client with the public key.
    Now WHat I do is generate the report which contain only the text data.Now I have one text file which I want to encrypt by using the public key. Currently I am encrypting by using the PGP desktop 9.8.
    Now as I already descibed want encrypt the text file throug public key through some java API.
    Recommended Bouncy Castle site is good and informative but confusion is I am not able to find out their API in the javadoc format.
    sabre150 can you provide me the javadoc link containing the API detail and also if you already know the direct class which I need to use ADD key and to encrypt etc.
    Hopefully this information is enough to provide consice answer.
    Thanks

  • Identifying a PGP encrypted file

    Is there a way to identify if a file is PGP encrypted or not by looking at the contents of the file? For example, a ZIP file can be identified by verifying if the first two chracters start with "PK".
    Thanks!!

    hi,
    You can write an adapter module to encypt your payload before sending to Reciever:
    /people/dijesh.tanna/blog/2008/09/15/sap-pi-integrating-macafee-e-business-server-with-sap-pi-70-for-pgp-encryptiondecryption
    http://www.bouncycastle.org/documentation.html
    http://www.cryptix.org/
    http://aedaptive.com/index.php/solutions/pgp-for-sap-netweaver
    http://www.pgpi.org/doc/pgpintro/
    PGP encryption: Do we need to write adapter module?
    If you are getting PGP file from sender and want  to send this file to target without any mapping transformation you can use this blog:
    /people/william.li/blog/2006/09/08/how-to-send-any-data-even-binary-through-xi-without-using-the-integration-repository
    Thanks.

  • Any gpg/pgp java api available

    Is there any java api available for GPG/PGP encryption without using the command line ?

    Thanks for the immediate response , Actually I need
    an api which doesn't use the command line.As I said - www.bouncycastle.org

  • Biztalk PGP encryption and signing

    Hi,
    Currently i am working on a custom pipeline component to PGP encrypt and sign the outgoing message from Biztalk 2013 with public and private keys.
    I am referring the content mentioned in the below posts
    https://code.msdn.microsoft.com/windowsdesktop/BizTalk-Sample-PGP-ebcbc8b2
    http://bajwork.blogspot.co.nz/2007/08/pgp-pipeline-component.html
    But we have a requirement to use PGP version 6.5.8 and i could not find what PGP versions the above components supports.
    Any one has any idea about Biztalk and PGP version 6.5.8 for encryption and signing?
    Thanks
    JB

    PGP has different versions and 6.5.8 is older one. If just download the Bouncy castle pgp dll, it’s not going to use the 6.5.8 version of PGP.
    http://www.pgpi.org/products/pgp/versions/freeware/win32/6.5.8/
    With latest Bouncy castle pgp dll, there are few issues encountered by the user you tried to use PGP version 6.5.8, especially around signature validation. Following are the discussion on
    the issues faced..
    http://stackoverflow.com/questions/7193323/encrypt-with-bc-and-decrypt-with-pgp-6-5-8
    http://bouncy-castle.1462172.n4.nabble.com/ERROR-encrypted-session-key-is-bad-when-trying-to-decrypt-td1466221.html
    http://bouncy-castle.1462172.n4.nabble.com/Compatibility-Issue-with-PGP-6-5-8-td1467170.html
     People have manage to get it working with few changes to the PGP code (which you can get it here
    http://www.bouncycastle.org/csharp/index.html )
    This forum is not the right place to raise question about finding the Bouncy castle pgp dll version compactable with v6.5.8. try to post this question here
    http://bouncy-castle.1462172.n4.nabble.com/
    Once you have their dll compactable with v 6.5.8, then you can use it in BizTalk suggested by the links referenced by you.
    If this answers your question please mark it accordingly. If this post is helpful, please vote as helpful by clicking the upward arrow mark next to my reply.

Maybe you are looking for

  • N97 system error message when starting Maps

    Hi all, I do get a system error message when starting the maps app. I know that this is not a new topic but I did not find after intensive search a solution. - Firmware is updated - soft reset done - it seems that the app is not installed - have dele

  • Apple iTunes U Contact for Business Development

    Hello,  I would like to talk with an Apple iTunes U Product Manager or Business Development Manager.  Does anyone have a contact they can provide?  Thank you.

  • ITunes said that me "There were errors or missions in the information."

    Hi All I don't download anything application.espacially don't download free applications.iTunes Store said that me "Your account has been accessed from a new computer or device, and you must verify your payment information before you can make purchas

  • Character Set Settings Affecting CSV Upload

    Hi, We have a production issue that I need a little help with. Using one of the examples listed here I have created a csv upload and on our dev box its works fine however on production we have a problem on production. The database is set to WE8ISO885

  • Telepresence Conductor Install Wizard Not Starting.

    Hello all, So I am trying to get an instance of Telepresence Conductor running in my environment.  I have deployed the .ova for both 3.0.2 and 2.4.1 on different ESX Hosts but regardless of the version or host when the appliance boots up and I log in