diff options
-rw-r--r-- | openpgp/NEWS | 1 | ||||
-rw-r--r-- | openpgp/src/crypto/mod.rs | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/openpgp/NEWS b/openpgp/NEWS index 0b889aab..9902943f 100644 --- a/openpgp/NEWS +++ b/openpgp/NEWS @@ -9,6 +9,7 @@ keys. Being lenient in this case helps the user recover their valuable key material. ** New functionality + - crypto::SessionKey::as_protected - types::AEADAlgorithm::GCM ** Deprecated functionality - types::Curve::len, use types::Curve::bits instead diff --git a/openpgp/src/crypto/mod.rs b/openpgp/src/crypto/mod.rs index 74a5c860..1c136102 100644 --- a/openpgp/src/crypto/mod.rs +++ b/openpgp/src/crypto/mod.rs @@ -117,6 +117,11 @@ impl SessionKey { random(&mut sk); Self(sk) } + + /// Returns a reference to the inner [`mem::Protected`]. + pub fn as_protected(&self) -> &mem::Protected { + &self.0 + } } impl Deref for SessionKey { |