Replies: 6 comments 12 replies
-
Hi @varsha123 , we need more information to understand the issue, can you share the code you used for signing? |
Beta Was this translation helpful? Give feedback.
-
Hi @larabr We used below code to sign our json file const privateKey = await openpgp.decryptKey({
privateKey: await openpgp.readPrivateKey({ armoredKey: privateKeyArmored }),
passphrase
});
const unsignedMessage = await openpgp.createCleartextMessage({ text: 'Hello, World!' });
const cleartextMessage = await openpgp.sign({
message: unsignedMessage, // CleartextMessage or Message object
signingKeys: privateKey
});
console.log(cleartextMessage); // '-----BEGIN PGP SIGNED MESSAGE ... END PGP SIGNATURE-----'
const signedMessage = await openpgp.readCleartextMessage({
cleartextMessage // parse armored message
}); also our PGP minimum requirement: Thanks |
Beta Was this translation helpful? Give feedback.
-
That code is from our readme, so not very helpful for debugging. |
Beta Was this translation helpful? Give feedback.
-
yes we are using our own private key and public key. -----BEGIN PGP PUBLIC KEY BLOCK----- my original file to sign is like
### below is signed text -----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512
{"header":{"totalCount":"1","batchId":"party_Onboarding_eb690d8b-99f1-48d1-b0a2-c684d20f0876",
"timeStamp":"1651134284"},"data":{"requests":[{"url":"/v1/scs/party","verb":"POST",
"header":{"X-SCS-TrackingId":"dddddd","requestId":"Req-10002022042813544444",
},"data":{"name":"laxman","partyRefId":"5b788c83-68cf-488b-81d1-a1cbd6ff99kp","status":"Active","kycCompleted":true,"validFrom":"26-APR-2022","validUntil":"30-APR-2022","responsibility":"Buyer","country":"SG","accounts":[],"contacts":[],"attributes":[{"paymentType":"RTGS","paymentInstrument":"LT"}]}}]}}
-----BEGIN PGP SIGNATURE-----
wsDzBAEBCgAGBQJidA49ACEJEML7z5ikFFcGFiEEkq4yIdfBuHGLnpFGwvvP
mKQUVwa1Jwv9HRxNXM9ApXam+sYEKIZVMMhSz4LgBMldtS6dJGd4AYiao2gJ
1rGLUgRZ9QggrCoqR/JHfOKg8SdlmbTvgp8sU9q7IUnTDIC/4i8OT7B+EDqZ
GTnXep1072Gf0i2rtMjC3cXUIBhVgqlBqo31bZMcxYBOYcCDFmTQE7VlsRmj
R7JrH2t8Mw7quvCtk3vncFkPbzstBljVtggjfzxg7/NukTDgPLnMD1KlkSAb
b1b4SA2CY65FSrGKmiEGe/C3sMSyDxqWsuv5hff7V3/fKvME9UpcSYO6V6+B
mQO0GViDV9xHKoHjRKGzhdhVk4ulipjVcEfaYo4fgjGrIloIYCAujIKeeF0I
LRg8IGrlfZpnM8Ps0JH9qvEQTE8YqpfBMiZCimreQihtdDt+PvknsSGYpupt
jNshGnFkNOCDEN3gWOER2pKEurFJtjKiXjOk2hLjepEvnJjJl2KmtChmbhEN
vYF78qcr7RKY72aJB1kDCkAKLUUiWHz/4VHIK11YswX4
=fo+Q
-----END PGP SIGNATURE----- for this we are getting error : unknown object in stream: 59 |
Beta Was this translation helpful? Give feedback.
-
It's not immediately obvious for me why BouncyCastle cannot parse the signed message, but Sequoia PGP and GPG seem to process it fine, so it's something on their side. I suggest you open an issue with BCPG. Something you might try is to generate a "normal" signed message instead of a cleartext one, by calling const unsignedMessage = await openpgp.createMessage({ text: 'Hello, World!' });
const signedMessage = await openpgp.sign({ // this is the same as before
message: unsignedMessage
signingKeys: privateKey
}); |
Beta Was this translation helpful? Give feedback.
-
Are you sure you want to create a clearsigned message? |
Beta Was this translation helpful? Give feedback.
-
NodeJS version : v14.16.1
We have signed message using openpgpjs and sent to our client that signed file getting failed at their end with error Invalid PGP Message File, they are using Bouncycastle library for verification.
Also we verified our singed file with https://8gwifi.org/pgpfileverify.jsp there also we are getting error : "error Invalid PGP Message File".
Please let me know how can we fix this .. Also are we using internally GPG to Encrypt and Sign Messages like this
https://www.digitalocean.com/community/tutorials/how-to-use-gpg-to-encrypt-and-sign-messages#how-to-verify-and-sign-keys
Please suggest how can we fix this
Thanks
Varsha
Beta Was this translation helpful? Give feedback.
All reactions