identity_jose/jwk/curve/
ec.rs1use core::fmt::Display;
5use core::fmt::Formatter;
6use core::fmt::Result;
7
8#[derive(Clone, Copy, Debug, Hash, PartialEq, Eq, PartialOrd, Ord)]
12pub enum EcCurve {
13 P256,
15 P384,
17 P521,
19 Secp256K1,
21}
22
23impl EcCurve {
24 pub const fn name(self) -> &'static str {
26 match self {
27 Self::P256 => "P-256",
28 Self::P384 => "P-384",
29 Self::P521 => "P-521",
30 Self::Secp256K1 => "secp256k1",
31 }
32 }
33}
34
35impl Display for EcCurve {
36 fn fmt(&self, f: &mut Formatter<'_>) -> Result {
37 f.write_str(self.name())
38 }
39}