| 1 |
//! OpenPGP profiles. |
| 2 |
|
| 3 |
/// Profiles select versions of the OpenPGP standard. |
| 4 |
#[derive(clap::ValueEnum, Debug, Clone, Copy)] |
| 5 |
pub enum Profile { |
| 6 |
/// RFC9580, published in 2024, defines "v6" OpenPGP. |
| 7 |
RFC9580, |
| 8 |
|
| 9 |
/// RFC4880, published in 2007, defines "v4" OpenPGP. |
| 10 |
RFC4880, |
| 11 |
} |
| 12 |
|
| 13 |
impl Default for Profile { |
| 14 |
fn default() -> Profile { |
| 15 |
match sequoia_openpgp::Profile::default() { |
| 16 |
sequoia_openpgp::Profile::RFC9580 => Profile::RFC9580, |
| 17 |
sequoia_openpgp::Profile::RFC4880 => Profile::RFC4880, |
| 18 |
_ => Profile::RFC9580, |
| 19 |
} |
| 20 |
} |
| 21 |
} |
| 22 |
|
| 23 |
impl From<Profile> for sequoia_openpgp::Profile { |
| 24 |
fn from(p: Profile) -> Self { |
| 25 |
match p { |
| 26 |
Profile::RFC9580 => sequoia_openpgp::Profile::RFC9580, |
| 27 |
Profile::RFC4880 => sequoia_openpgp::Profile::RFC4880, |
| 28 |
} |
| 29 |
} |
| 30 |
} |