@@ -62,6 +62,12 @@ pub enum JsonWebSignatureAlg {
6262 /// ECDSA using secp256k1 curve and SHA-256
6363 Es256K ,
6464
65+ /// EdDSA using Ed25519 curve
66+ Ed25519 ,
67+
68+ /// EdDSA using Ed448 curve
69+ Ed448 ,
70+
6571 /// An unknown value.
6672 Unknown ( String ) ,
6773}
@@ -84,6 +90,8 @@ impl core::fmt::Display for JsonWebSignatureAlg {
8490 Self :: None => write ! ( f, "none" ) ,
8591 Self :: EdDsa => write ! ( f, "EdDSA" ) ,
8692 Self :: Es256K => write ! ( f, "ES256K" ) ,
93+ Self :: Ed25519 => write ! ( f, "Ed25519" ) ,
94+ Self :: Ed448 => write ! ( f, "Ed448" ) ,
8795 Self :: Unknown ( value) => write ! ( f, "{value}" ) ,
8896 }
8997 }
@@ -109,12 +117,13 @@ impl core::str::FromStr for JsonWebSignatureAlg {
109117 "none" => Ok ( Self :: None ) ,
110118 "EdDSA" => Ok ( Self :: EdDsa ) ,
111119 "ES256K" => Ok ( Self :: Es256K ) ,
120+ "Ed25519" => Ok ( Self :: Ed25519 ) ,
121+ "Ed448" => Ok ( Self :: Ed448 ) ,
112122 value => Ok ( Self :: Unknown ( value. to_owned ( ) ) ) ,
113123 }
114124 }
115125}
116126
117- #[ cfg( feature = "serde" ) ]
118127impl < ' de > serde:: Deserialize < ' de > for JsonWebSignatureAlg {
119128 fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
120129 where
@@ -125,7 +134,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebSignatureAlg {
125134 }
126135}
127136
128- #[ cfg( feature = "serde" ) ]
129137impl serde:: Serialize for JsonWebSignatureAlg {
130138 fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
131139 where
@@ -135,7 +143,6 @@ impl serde::Serialize for JsonWebSignatureAlg {
135143 }
136144}
137145
138- #[ cfg( feature = "schemars" ) ]
139146impl schemars:: JsonSchema for JsonWebSignatureAlg {
140147 fn schema_name ( ) -> String {
141148 "JsonWebSignatureAlg" . to_owned ( )
@@ -339,6 +346,32 @@ impl schemars::JsonSchema for JsonWebSignatureAlg {
339346 ..Default :: default ( )
340347 }
341348 . into( ) ,
349+ // ---
350+ schemars:: schema:: SchemaObject {
351+ metadata: Some ( Box :: new( schemars:: schema:: Metadata {
352+ description: Some (
353+ // ---
354+ r"EdDSA using Ed25519 curve" . to_owned( ) ,
355+ ) ,
356+ ..Default :: default ( )
357+ } ) ) ,
358+ const_value: Some ( "Ed25519" . into( ) ) ,
359+ ..Default :: default ( )
360+ }
361+ . into( ) ,
362+ // ---
363+ schemars:: schema:: SchemaObject {
364+ metadata: Some ( Box :: new( schemars:: schema:: Metadata {
365+ description: Some (
366+ // ---
367+ r"EdDSA using Ed448 curve" . to_owned( ) ,
368+ ) ,
369+ ..Default :: default ( )
370+ } ) ) ,
371+ const_value: Some ( "Ed448" . into( ) ) ,
372+ ..Default :: default ( )
373+ }
374+ . into( ) ,
342375 ] ;
343376
344377 let description = r#"JSON Web Signature "alg" parameter"# ;
@@ -480,7 +513,6 @@ impl core::str::FromStr for JsonWebEncryptionAlg {
480513 }
481514}
482515
483- #[ cfg( feature = "serde" ) ]
484516impl < ' de > serde:: Deserialize < ' de > for JsonWebEncryptionAlg {
485517 fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
486518 where
@@ -491,7 +523,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebEncryptionAlg {
491523 }
492524}
493525
494- #[ cfg( feature = "serde" ) ]
495526impl serde:: Serialize for JsonWebEncryptionAlg {
496527 fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
497528 where
@@ -501,7 +532,6 @@ impl serde::Serialize for JsonWebEncryptionAlg {
501532 }
502533}
503534
504- #[ cfg( feature = "schemars" ) ]
505535impl schemars:: JsonSchema for JsonWebEncryptionAlg {
506536 fn schema_name ( ) -> String {
507537 "JsonWebEncryptionAlg" . to_owned ( )
@@ -833,7 +863,6 @@ impl core::str::FromStr for JsonWebEncryptionEnc {
833863 }
834864}
835865
836- #[ cfg( feature = "serde" ) ]
837866impl < ' de > serde:: Deserialize < ' de > for JsonWebEncryptionEnc {
838867 fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
839868 where
@@ -844,7 +873,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebEncryptionEnc {
844873 }
845874}
846875
847- #[ cfg( feature = "serde" ) ]
848876impl serde:: Serialize for JsonWebEncryptionEnc {
849877 fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
850878 where
@@ -854,7 +882,6 @@ impl serde::Serialize for JsonWebEncryptionEnc {
854882 }
855883}
856884
857- #[ cfg( feature = "schemars" ) ]
858885impl schemars:: JsonSchema for JsonWebEncryptionEnc {
859886 fn schema_name ( ) -> String {
860887 "JsonWebEncryptionEnc" . to_owned ( )
@@ -992,7 +1019,6 @@ impl core::str::FromStr for JsonWebEncryptionCompressionAlgorithm {
9921019 }
9931020}
9941021
995- #[ cfg( feature = "serde" ) ]
9961022impl < ' de > serde:: Deserialize < ' de > for JsonWebEncryptionCompressionAlgorithm {
9971023 fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
9981024 where
@@ -1003,7 +1029,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebEncryptionCompressionAlgorithm {
10031029 }
10041030}
10051031
1006- #[ cfg( feature = "serde" ) ]
10071032impl serde:: Serialize for JsonWebEncryptionCompressionAlgorithm {
10081033 fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
10091034 where
@@ -1013,7 +1038,6 @@ impl serde::Serialize for JsonWebEncryptionCompressionAlgorithm {
10131038 }
10141039}
10151040
1016- #[ cfg( feature = "schemars" ) ]
10171041impl schemars:: JsonSchema for JsonWebEncryptionCompressionAlgorithm {
10181042 fn schema_name ( ) -> String {
10191043 "JsonWebEncryptionCompressionAlgorithm" . to_owned ( )
@@ -1101,7 +1125,6 @@ impl core::str::FromStr for JsonWebKeyType {
11011125 }
11021126}
11031127
1104- #[ cfg( feature = "serde" ) ]
11051128impl < ' de > serde:: Deserialize < ' de > for JsonWebKeyType {
11061129 fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
11071130 where
@@ -1112,7 +1135,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebKeyType {
11121135 }
11131136}
11141137
1115- #[ cfg( feature = "serde" ) ]
11161138impl serde:: Serialize for JsonWebKeyType {
11171139 fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
11181140 where
@@ -1122,7 +1144,6 @@ impl serde::Serialize for JsonWebKeyType {
11221144 }
11231145}
11241146
1125- #[ cfg( feature = "schemars" ) ]
11261147impl schemars:: JsonSchema for JsonWebKeyType {
11271148 fn schema_name ( ) -> String {
11281149 "JsonWebKeyType" . to_owned ( )
@@ -1249,7 +1270,6 @@ impl core::str::FromStr for JsonWebKeyEcEllipticCurve {
12491270 }
12501271}
12511272
1252- #[ cfg( feature = "serde" ) ]
12531273impl < ' de > serde:: Deserialize < ' de > for JsonWebKeyEcEllipticCurve {
12541274 fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
12551275 where
@@ -1260,7 +1280,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebKeyEcEllipticCurve {
12601280 }
12611281}
12621282
1263- #[ cfg( feature = "serde" ) ]
12641283impl serde:: Serialize for JsonWebKeyEcEllipticCurve {
12651284 fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
12661285 where
@@ -1270,7 +1289,6 @@ impl serde::Serialize for JsonWebKeyEcEllipticCurve {
12701289 }
12711290}
12721291
1273- #[ cfg( feature = "schemars" ) ]
12741292impl schemars:: JsonSchema for JsonWebKeyEcEllipticCurve {
12751293 fn schema_name ( ) -> String {
12761294 "JsonWebKeyEcEllipticCurve" . to_owned ( )
@@ -1397,7 +1415,6 @@ impl core::str::FromStr for JsonWebKeyOkpEllipticCurve {
13971415 }
13981416}
13991417
1400- #[ cfg( feature = "serde" ) ]
14011418impl < ' de > serde:: Deserialize < ' de > for JsonWebKeyOkpEllipticCurve {
14021419 fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
14031420 where
@@ -1408,7 +1425,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebKeyOkpEllipticCurve {
14081425 }
14091426}
14101427
1411- #[ cfg( feature = "serde" ) ]
14121428impl serde:: Serialize for JsonWebKeyOkpEllipticCurve {
14131429 fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
14141430 where
@@ -1418,7 +1434,6 @@ impl serde::Serialize for JsonWebKeyOkpEllipticCurve {
14181434 }
14191435}
14201436
1421- #[ cfg( feature = "schemars" ) ]
14221437impl schemars:: JsonSchema for JsonWebKeyOkpEllipticCurve {
14231438 fn schema_name ( ) -> String {
14241439 "JsonWebKeyOkpEllipticCurve" . to_owned ( )
@@ -1535,7 +1550,6 @@ impl core::str::FromStr for JsonWebKeyUse {
15351550 }
15361551}
15371552
1538- #[ cfg( feature = "serde" ) ]
15391553impl < ' de > serde:: Deserialize < ' de > for JsonWebKeyUse {
15401554 fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
15411555 where
@@ -1546,7 +1560,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebKeyUse {
15461560 }
15471561}
15481562
1549- #[ cfg( feature = "serde" ) ]
15501563impl serde:: Serialize for JsonWebKeyUse {
15511564 fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
15521565 where
@@ -1556,7 +1569,6 @@ impl serde::Serialize for JsonWebKeyUse {
15561569 }
15571570}
15581571
1559- #[ cfg( feature = "schemars" ) ]
15601572impl schemars:: JsonSchema for JsonWebKeyUse {
15611573 fn schema_name ( ) -> String {
15621574 "JsonWebKeyUse" . to_owned ( )
@@ -1677,7 +1689,6 @@ impl core::str::FromStr for JsonWebKeyOperation {
16771689 }
16781690}
16791691
1680- #[ cfg( feature = "serde" ) ]
16811692impl < ' de > serde:: Deserialize < ' de > for JsonWebKeyOperation {
16821693 fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
16831694 where
@@ -1688,7 +1699,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebKeyOperation {
16881699 }
16891700}
16901701
1691- #[ cfg( feature = "serde" ) ]
16921702impl serde:: Serialize for JsonWebKeyOperation {
16931703 fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
16941704 where
@@ -1698,7 +1708,6 @@ impl serde::Serialize for JsonWebKeyOperation {
16981708 }
16991709}
17001710
1701- #[ cfg( feature = "schemars" ) ]
17021711impl schemars:: JsonSchema for JsonWebKeyOperation {
17031712 fn schema_name ( ) -> String {
17041713 "JsonWebKeyOperation" . to_owned ( )
0 commit comments