diff options
author | Justus Winter <justus@sequoia-pgp.org> | 2019-02-18 18:25:36 +0100 |
---|---|---|
committer | Justus Winter <justus@sequoia-pgp.org> | 2019-02-18 18:25:36 +0100 |
commit | 8a02ecd113ec4e14effd522ea0c51fbc691b0291 (patch) | |
tree | 372701e686b4e71c599396ca281692c8788f66ed /openpgp | |
parent | 85314febcc40cb7611964098bd869bcd0ca3d1c7 (diff) |
openpgp: Implement From<Vec<u8>> for MPI.
Diffstat (limited to 'openpgp')
-rw-r--r-- | openpgp/src/crypto/mpis.rs | 6 |
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. /// |