summaryrefslogtreecommitdiffstats
path: root/openpgp
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2019-02-18 18:25:36 +0100
committerJustus Winter <justus@sequoia-pgp.org>2019-02-18 18:25:36 +0100
commit8a02ecd113ec4e14effd522ea0c51fbc691b0291 (patch)
tree372701e686b4e71c599396ca281692c8788f66ed /openpgp
parent85314febcc40cb7611964098bd869bcd0ca3d1c7 (diff)
openpgp: Implement From<Vec<u8>> for MPI.
Diffstat (limited to 'openpgp')
-rw-r--r--openpgp/src/crypto/mpis.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/openpgp/src/crypto/mpis.rs b/openpgp/src/crypto/mpis.rs
index 2a7cd678..7e1fc7ed 100644
--- a/openpgp/src/crypto/mpis.rs
+++ b/openpgp/src/crypto/mpis.rs
@@ -27,6 +27,12 @@ pub struct MPI {
pub value: Box<[u8]>,
}
+impl From<Vec<u8>> for MPI {
+ fn from(v: Vec<u8>) -> Self {
+ Self::new(&v)
+ }
+}
+
impl MPI {
/// Creates a new MPI.
///