feat: v0.2.0-dev, encrypt supports x25519

This commit is contained in:
2023-10-08 00:49:17 +08:00
parent 9637ef9e01
commit 0bdb89ad25
6 changed files with 113 additions and 4 deletions

View File

@@ -50,6 +50,8 @@ pub struct TinyEncryptEnvelop {
pub enum TinyEncryptEnvelopType {
#[serde(rename = "pgp")]
Pgp,
#[serde(rename = "pgp-x25519")]
PgpX25519,
#[serde(rename = "age")]
Age,
#[serde(rename = "ecdh")]
@@ -65,6 +67,7 @@ impl TinyEncryptEnvelopType {
pub fn get_name(&self) -> &'static str {
match self {
TinyEncryptEnvelopType::Pgp => "pgp",
TinyEncryptEnvelopType::PgpX25519 => "pgp-x25519",
TinyEncryptEnvelopType::Age => "age",
TinyEncryptEnvelopType::Ecdh => "ecdh",
TinyEncryptEnvelopType::Kms => "kms",