PGP Encryption using PGPFileService in LANSA Integrator

This Q&A forum allows users to post and respond to "How Do I Do ....." questions. Please do not use to report (suspected) errors - you must use your regional help desk for this. The information contained in this forum has not been validated by LANSA and, as such, LANSA cannot guarantee the accuracy of the information.
Post Reply
jccobank
Posts: 2
Joined: Thu Oct 05, 2023 1:37 am

PGP Encryption using PGPFileService in LANSA Integrator

Post by jccobank » Sat Mar 30, 2024 12:40 am

I get the following error in the JSM trace when trying to encode a file using PGPFileService. It looks like it can't resolve to some bouncycastle resources?

Any help would be greatly appreciated

--------------------------------------------------
Process : ZPROC
Function : ZFUNC
Partition : DVR
Job Name : QPADEV0002
Job User : USERXXX
Job Number : 895277
Command : ENCODE ARMORED(*NO) FROM(foo1.txt) TO(foo1.gpg) COMPRESSED(*YES) SIGNER(78439F25DA2E2C98:*****) CIPHER(*AES-128) REPLACE(*YES)
Determine canonical path of : /DIRXXXj/foo1.gpg
Create temporary file
Using canonical path : /DIRXXX/foo1.gpg
Remove temporary file
Determine canonical path of : /DIRXXX/foo1.txt
File exists, using canonical path : /DIRXXX/foo1.txt
Replace : true
Encode file : /DIRXXX/foo1.txt
file : /DIRXXX/foo1.gpg
Read collections
Public collection
Public ring 0
Public key 0 [78439F25DA2E2C98][VERSION_4][PUBLIC_MASTER][PUBLIC_ENCRYPTION][RSA_GENERAL][4096][XYZ <xxxxxx@hotmail.com>]
Public key 1 [F3E8D51140827500][VERSION_4][PUBLIC_ENCRYPTION][RSA_GENERAL][4096]
Secret collection
Secret ring 0
Secret key 0 [78439F25DA2E2C98][SECRET_MASTER][SECRET_SIGNING][AES-128][XYZ <xxxxx@hotmail.com>]
Secret key 1 [F3E8D51140827500][SECRET_SIGNING][AES-128]
Get signing key for ID: 78439F25DA2E2C98
[78439F25DA2E2C98][SECRET_MASTER][SECRET_SIGNING][AES-128][XYZ <xxxxxx@hotmail.com>]
Data encryption: AES-128
Get recipients
78439F25DA2E2C98
Get encryption keys
[78439F25DA2E2C98][VERSION_4][PUBLIC_MASTER][PUBLIC_ENCRYPTION][RSA_GENERAL][4096][XYZ <xxxxx@hotmail.com>]
*** WARNING using the same key for signing and encryption: 78439F25DA2E2C98 ***
Create message compressed encrypted signed


stack trace: org.bouncycastle.openpgp.PGPException: exception encrypting session key
at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source)
at org.bouncycastle.openpgp.PGPEncryptedDataGenerator.open(Unknown Source)
at com.lansa.jsm.service.PGPHelper.a(Unknown Source)
at com.lansa.jsm.service.PGPHelper.a(Unknown Source)
at com.lansa.jsm.service.PGPFileService.do(Unknown Source)
at com.lansa.jsm.service.PGPFileService.try(Unknown Source)
at com.lansa.jsm.service.PGPFileService.command(Unknown Source)
at com.lansa.jsm.f.a(Unknown Source)
at com.lansa.jsm.f.if(Unknown Source)
at com.lansa.jsm.f.run(Unknown Source)
Caused by: java.lang.SecurityException: JCE cannot authenticate the provider BC
at javax.crypto.Cipher.getInstance(Unknown Source)
at org.bouncycastle.openpgp.PGPEncryptedDataGenerator$PubMethod.addSessionInfo(Unknown Source)
... 10 more
Caused by: java.util.jar.JarException: file:/jsm/instance/jar/jsmbcprov.jar has unsigned entries - org/bouncycastle/LICENSE.class
at javax.crypto.a.a(Unknown Source)
at javax.crypto.a.a(Unknown Source)
at javax.crypto.a.a(Unknown Source)
at javax.crypto.b.b(Unknown Source)
at javax.crypto.b.a(Unknown Source)
at javax.crypto.b.b(Unknown Source)
at javax.crypto.Cipher.getInstance(Unknown Source)
at com.lansa.jsm.JSMManager.goto(Unknown Source)
at com.lansa.jsm.JSMManager.new(Unknown Source)
at com.lansa.jsm.JSMManager.main(Unknown Source)

Command : ERROR : "exception encrypting session key"

Post Reply