1
0
Fork 0
mirror of https://github.com/pgpainless/pgpainless.git synced 2025-09-10 10:49:39 +02:00

replace create{Encryptor,Decryptor} methods with encryptAndOrSign,decryptAndOrVerify

This commit is contained in:
Paul Schaub 2020-11-29 15:33:54 +01:00
parent accb18bd4e
commit cc1e4601e3
Signed by: vanitasvitae
GPG key ID: 62BEE9264BF17311
6 changed files with 33 additions and 12 deletions

View file

@ -76,7 +76,7 @@ Take for example a look at this delicious key:
Encrypting and signing data is pretty straight forward as well.
```java
EncryptionStream encryptor = PGPainless.createEncryptor()
EncryptionStream encryptor = PGPainless.encryptAndOrSign()
.onOutputStream(targetOuputStream)
.toRecipients(publicKeyRings)
.usingSecureAlgorithms()
@ -109,7 +109,7 @@ This object will contain information like to which keys the message is encrypted
To process incoming encrypted / signed data, just do the following:
```java
DecryptionStream decryptor = PGPainless.createDecryptor()
DecryptionStream decryptor = PGPainless.decryptAndOrVerify()
.onInputStream(sourceInputStream) // insert encrypted data here
.decryptWith(secretKeyDecryptor, secretKey)
.verifyWith(trustedKeyIds, senderKeys)