From e7e269d7ceabf7dac3226417ea42b5fee30a0cb9 Mon Sep 17 00:00:00 2001 From: Paul Schaub Date: Fri, 6 Oct 2023 12:46:17 +0200 Subject: [PATCH] Documentation: Add section on reading certificates --- docs/source/pgpainless-core/quickstart.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/source/pgpainless-core/quickstart.md b/docs/source/pgpainless-core/quickstart.md index abb86358..1816983f 100644 --- a/docs/source/pgpainless-core/quickstart.md +++ b/docs/source/pgpainless-core/quickstart.md @@ -50,9 +50,15 @@ There is a very good chance that you can find code examples there that fit your Reading keys from ASCII armored strings or from binary files is easy: ```java +// Secret Keys String key = "-----BEGIN PGP PRIVATE KEY BLOCK-----\n"...; PGPSecretKeyRing secretKey = PGPainless.readKeyRing() .secretKeyRing(key); + +// Certificates (Public Keys) +String cert = "-----BEGIN PGP PUBLIC KEY BLOCK-----\n..."; +PGPPublicKeyRing certificate = PGPainless.readKeyRing() + .publicKeyRing(cert); ``` Similarly, keys or certificates can quickly be exported: