summaryrefslogtreecommitdiffstats
path: root/guide
diff options
context:
space:
mode:
authorNeal H. Walfield <neal@pep.foundation>2019-08-04 00:27:41 +0200
committerNeal H. Walfield <neal@pep.foundation>2019-08-23 19:15:13 +0200
commit75fb008711f0f80028230018ab37b988175211b4 (patch)
treeb8b950cbed6152f4812f0943125ba6dd8647de93 /guide
parent4c6974c62591ef6698447712311edebca9546e5f (diff)
openpgp: Rename SubkeyBinding to KeyBinding.
- Also rename the `subkey` method to `key`.
Diffstat (limited to 'guide')
-rw-r--r--guide/src/chapter_02.md8
-rw-r--r--guide/src/chapter_03.md4
2 files changed, 6 insertions, 6 deletions
diff --git a/guide/src/chapter_02.md b/guide/src/chapter_02.md
index 7794436e..b6463033 100644
--- a/guide/src/chapter_02.md
+++ b/guide/src/chapter_02.md
@@ -119,7 +119,7 @@ fn main() {
# {
# // The encryption key is the first and only subkey.
# let key = self.secret.subkeys().nth(0)
-# .map(|binding| binding.subkey().clone())
+# .map(|binding| binding.key().clone())
# .unwrap();
#
# // The secret key is not encrypted.
@@ -253,7 +253,7 @@ fn generate() -> openpgp::Result<openpgp::TPK> {
# {
# // The encryption key is the first and only subkey.
# let key = self.secret.subkeys().nth(0)
-# .map(|binding| binding.subkey().clone())
+# .map(|binding| binding.key().clone())
# .unwrap();
#
# // The secret key is not encrypted.
@@ -387,7 +387,7 @@ fn encrypt(sink: &mut Write, plaintext: &str, recipient: &openpgp::TPK)
# {
# // The encryption key is the first and only subkey.
# let key = self.secret.subkeys().nth(0)
-# .map(|binding| binding.subkey().clone())
+# .map(|binding| binding.key().clone())
# .unwrap();
#
# // The secret key is not encrypted.
@@ -535,7 +535,7 @@ impl<'a> DecryptionHelper for Helper<'a> {
{
// The encryption key is the first and only subkey.
let key = self.secret.subkeys().nth(0)
- .map(|binding| binding.subkey().clone())
+ .map(|binding| binding.key().clone())
.unwrap();
// The secret key is not encrypted.
diff --git a/guide/src/chapter_03.md b/guide/src/chapter_03.md
index 80d5cc1c..0d8e9996 100644
--- a/guide/src/chapter_03.md
+++ b/guide/src/chapter_03.md
@@ -53,9 +53,9 @@ fn main() {
// Iterate over subkeys.
assert_eq!(tpk.subkeys().count(), 2);
- assert_eq!(tpk.subkeys().nth(0).unwrap().subkey().fingerprint().to_string(),
+ assert_eq!(tpk.subkeys().nth(0).unwrap().key().fingerprint().to_string(),
"67A4 8753 A380 A6B3 B7DF 7DC5 E6C6 897A 4CEF 8924");
- assert_eq!(tpk.subkeys().nth(1).unwrap().subkey().fingerprint().to_string(),
+ assert_eq!(tpk.subkeys().nth(1).unwrap().key().fingerprint().to_string(),
"185C DAA1 2723 0423 19E4 7F67 108F 2CAF 9034 356D");
}
```