summaryrefslogtreecommitdiffstats
path: root/guide
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-10-22 16:29:02 +0200
committerJustus Winter <justus@sequoia-pgp.org>2020-10-22 16:29:02 +0200
commit5ff30d8ed398fc6c3e973773043c8211214db63c (patch)
tree8f74c268d420ecb227dcd028b23ffa52f09ac42c /guide
parent06bd95ec9165aa723356ec999f87c86f57b7e065 (diff)
openpgp: Select only supported encryption-capable keys.
Diffstat (limited to 'guide')
-rw-r--r--guide/src/chapter_01.md8
-rw-r--r--guide/src/chapter_02.md8
2 files changed, 8 insertions, 8 deletions
diff --git a/guide/src/chapter_01.md b/guide/src/chapter_01.md
index f1dbc653..874b70e6 100644
--- a/guide/src/chapter_01.md
+++ b/guide/src/chapter_01.md
@@ -61,7 +61,7 @@ fn main() -> openpgp::Result<()> {
# // Get the keypair to do the signing from the Cert.
# let keypair = tsk
# .keys().unencrypted_secret()
-# .with_policy(policy, None).alive().revoked(false).for_signing()
+# .with_policy(policy, None).supported().alive().revoked(false).for_signing()
# .nth(0).unwrap().key().clone().into_keypair()?;
#
# // Start streaming an OpenPGP message.
@@ -212,7 +212,7 @@ fn generate() -> openpgp::Result<openpgp::Cert> {
# // Get the keypair to do the signing from the Cert.
# let keypair = tsk
# .keys().unencrypted_secret()
-# .with_policy(policy, None).alive().revoked(false).for_signing()
+# .with_policy(policy, None).supported().alive().revoked(false).for_signing()
# .nth(0).unwrap().key().clone().into_keypair()?;
#
# // Start streaming an OpenPGP message.
@@ -363,7 +363,7 @@ fn sign(policy: &dyn Policy,
// Get the keypair to do the signing from the Cert.
let keypair = tsk
.keys().unencrypted_secret()
- .with_policy(policy, None).alive().revoked(false).for_signing()
+ .with_policy(policy, None).supported().alive().revoked(false).for_signing()
.nth(0).unwrap().key().clone().into_keypair()?;
// Start streaming an OpenPGP message.
@@ -525,7 +525,7 @@ Verified data can be read from this using [`io::Read`].
# // Get the keypair to do the signing from the Cert.
# let keypair = tsk
# .keys().unencrypted_secret()
-# .with_policy(policy, None).alive().revoked(false).for_signing()
+# .with_policy(policy, None).supported().alive().revoked(false).for_signing()
# .nth(0).unwrap().key().clone().into_keypair()?;
#
# // Start streaming an OpenPGP message.
diff --git a/guide/src/chapter_02.md b/guide/src/chapter_02.md
index 052d59b8..7d663701 100644
--- a/guide/src/chapter_02.md
+++ b/guide/src/chapter_02.md
@@ -58,7 +58,7 @@ fn main() -> openpgp::Result<()> {
# sink: &mut dyn Write, plaintext: &str, recipient: &openpgp::Cert)
# -> openpgp::Result<()> {
# let recipients =
-# recipient.keys().with_policy(policy, None).alive().revoked(false)
+# recipient.keys().with_policy(policy, None).supported().alive().revoked(false)
# .for_transport_encryption();
#
# // Start streaming an OpenPGP message.
@@ -206,7 +206,7 @@ fn generate() -> openpgp::Result<openpgp::Cert> {
# sink: &mut dyn Write, plaintext: &str, recipient: &openpgp::Cert)
# -> openpgp::Result<()> {
# let recipients =
-# recipient.keys().with_policy(policy, None).alive().revoked(false)
+# recipient.keys().with_policy(policy, None).supported().alive().revoked(false)
# .for_transport_encryption();
#
# // Start streaming an OpenPGP message.
@@ -354,7 +354,7 @@ fn encrypt(policy: &dyn Policy,
sink: &mut dyn Write, plaintext: &str, recipient: &openpgp::Cert)
-> openpgp::Result<()> {
let recipients =
- recipient.keys().with_policy(policy, None).alive().revoked(false)
+ recipient.keys().with_policy(policy, None).supported().alive().revoked(false)
.for_transport_encryption();
// Start streaming an OpenPGP message.
@@ -516,7 +516,7 @@ Decrypted data can be read from this using [`io::Read`].
# sink: &mut dyn Write, plaintext: &str, recipient: &openpgp::Cert)
# -> openpgp::Result<()> {
# let recipients =
-# recipient.keys().with_policy(policy, None).alive().revoked(false)
+# recipient.keys().with_policy(policy, None).supported().alive().revoked(false)
# .for_transport_encryption();
#
# // Start streaming an OpenPGP message.