mirror of
https://github.com/pgpainless/pgpainless.git
synced 2024-12-22 19:08:00 +01:00
Documentation: Add section on reading certificates
This commit is contained in:
parent
41dfe71994
commit
e7e269d7ce
1 changed files with 6 additions and 0 deletions
|
@ -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:
|
Reading keys from ASCII armored strings or from binary files is easy:
|
||||||
|
|
||||||
```java
|
```java
|
||||||
|
// Secret Keys
|
||||||
String key = "-----BEGIN PGP PRIVATE KEY BLOCK-----\n"...;
|
String key = "-----BEGIN PGP PRIVATE KEY BLOCK-----\n"...;
|
||||||
PGPSecretKeyRing secretKey = PGPainless.readKeyRing()
|
PGPSecretKeyRing secretKey = PGPainless.readKeyRing()
|
||||||
.secretKeyRing(key);
|
.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:
|
Similarly, keys or certificates can quickly be exported:
|
||||||
|
|
Loading…
Reference in a new issue