feat: encrypt
This commit is contained in:
@@ -88,11 +88,11 @@ fn encrypt_single(path: &PathBuf, envelops: &[&TinyEncryptConfigEnvelop], cmd_en
|
||||
if cmd_encrypt.compatible_with_1_0 {
|
||||
if let Some(envelops) = &encrypt_meta.envelops {
|
||||
for envelop in envelops {
|
||||
if envelop.r#type == TinyEncryptEnvelopType::Pgp {
|
||||
if (envelop.r#type == TinyEncryptEnvelopType::Pgp) && encrypt_meta.pgp_envelop.is_none() {
|
||||
encrypt_meta.pgp_fingerprint = Some(format!("KID:{}", envelop.kid));
|
||||
encrypt_meta.pgp_envelop = Some(envelop.encrypted_key.clone());
|
||||
}
|
||||
if envelop.r#type == TinyEncryptEnvelopType::Ecdh {
|
||||
if (envelop.r#type == TinyEncryptEnvelopType::Ecdh) && encrypt_meta.ecdh_envelop.is_none() {
|
||||
encrypt_meta.ecdh_point = Some(format!("KID:{}", envelop.kid));
|
||||
encrypt_meta.ecdh_envelop = Some(envelop.encrypted_key.clone());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user