Encrypt Buffer/UInt8Array with public keys? #1537
eep-oop-urp
started this conversation in
General
Replies: 2 comments 1 reply
-
Yes, it's possible. Please see the documentation, or you can combine aspects from different examples. |
Beta Was this translation helpful? Give feedback.
0 replies
-
Hi @eep-oop-urp , yes it is possible, the examples only show the most popular combination of options, but you can "mix and match" them. const publicKey = await openpgp.readKey({ armoredKey: publicKeyArmored });
const data = new Uint8Array(..);
const encrypted = await openpgp.encrypt({
message: await openpgp.createMessage({ binary: data }),
encryptionKeys: publicKey
}); You can also pass |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I've been struggling with how to use this library in an AWS lambda using NodeJS 14.x and TypeScript.
I attempted to write code that downloads a PDF from S3 using the aws-sdk and encrypt it with a public key, but to no avail.
In the documentation, there are examples of encrypting a UInt8Array with a password and of encrypting a WebStream with public keys. I can't use the latter because ReadableStream is not available in NodeJS 14 and I can't upgrade to NodeJS 18.
I didn't find an example of encrypting a UInt8Array with a public key. Is this possible? If so, is there an example?
Beta Was this translation helpful? Give feedback.
All reactions