@@ -62,6 +62,12 @@ pub enum JsonWebSignatureAlg {
62
62
/// ECDSA using secp256k1 curve and SHA-256
63
63
Es256K ,
64
64
65
+ /// EdDSA using Ed25519 curve
66
+ Ed25519 ,
67
+
68
+ /// EdDSA using Ed448 curve
69
+ Ed448 ,
70
+
65
71
/// An unknown value.
66
72
Unknown ( String ) ,
67
73
}
@@ -84,6 +90,8 @@ impl core::fmt::Display for JsonWebSignatureAlg {
84
90
Self :: None => write ! ( f, "none" ) ,
85
91
Self :: EdDsa => write ! ( f, "EdDSA" ) ,
86
92
Self :: Es256K => write ! ( f, "ES256K" ) ,
93
+ Self :: Ed25519 => write ! ( f, "Ed25519" ) ,
94
+ Self :: Ed448 => write ! ( f, "Ed448" ) ,
87
95
Self :: Unknown ( value) => write ! ( f, "{value}" ) ,
88
96
}
89
97
}
@@ -109,12 +117,13 @@ impl core::str::FromStr for JsonWebSignatureAlg {
109
117
"none" => Ok ( Self :: None ) ,
110
118
"EdDSA" => Ok ( Self :: EdDsa ) ,
111
119
"ES256K" => Ok ( Self :: Es256K ) ,
120
+ "Ed25519" => Ok ( Self :: Ed25519 ) ,
121
+ "Ed448" => Ok ( Self :: Ed448 ) ,
112
122
value => Ok ( Self :: Unknown ( value. to_owned ( ) ) ) ,
113
123
}
114
124
}
115
125
}
116
126
117
- #[ cfg( feature = "serde" ) ]
118
127
impl < ' de > serde:: Deserialize < ' de > for JsonWebSignatureAlg {
119
128
fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
120
129
where
@@ -125,7 +134,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebSignatureAlg {
125
134
}
126
135
}
127
136
128
- #[ cfg( feature = "serde" ) ]
129
137
impl serde:: Serialize for JsonWebSignatureAlg {
130
138
fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
131
139
where
@@ -135,7 +143,6 @@ impl serde::Serialize for JsonWebSignatureAlg {
135
143
}
136
144
}
137
145
138
- #[ cfg( feature = "schemars" ) ]
139
146
impl schemars:: JsonSchema for JsonWebSignatureAlg {
140
147
fn schema_name ( ) -> String {
141
148
"JsonWebSignatureAlg" . to_owned ( )
@@ -339,6 +346,32 @@ impl schemars::JsonSchema for JsonWebSignatureAlg {
339
346
..Default :: default ( )
340
347
}
341
348
. 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( ) ,
342
375
] ;
343
376
344
377
let description = r#"JSON Web Signature "alg" parameter"# ;
@@ -480,7 +513,6 @@ impl core::str::FromStr for JsonWebEncryptionAlg {
480
513
}
481
514
}
482
515
483
- #[ cfg( feature = "serde" ) ]
484
516
impl < ' de > serde:: Deserialize < ' de > for JsonWebEncryptionAlg {
485
517
fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
486
518
where
@@ -491,7 +523,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebEncryptionAlg {
491
523
}
492
524
}
493
525
494
- #[ cfg( feature = "serde" ) ]
495
526
impl serde:: Serialize for JsonWebEncryptionAlg {
496
527
fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
497
528
where
@@ -501,7 +532,6 @@ impl serde::Serialize for JsonWebEncryptionAlg {
501
532
}
502
533
}
503
534
504
- #[ cfg( feature = "schemars" ) ]
505
535
impl schemars:: JsonSchema for JsonWebEncryptionAlg {
506
536
fn schema_name ( ) -> String {
507
537
"JsonWebEncryptionAlg" . to_owned ( )
@@ -833,7 +863,6 @@ impl core::str::FromStr for JsonWebEncryptionEnc {
833
863
}
834
864
}
835
865
836
- #[ cfg( feature = "serde" ) ]
837
866
impl < ' de > serde:: Deserialize < ' de > for JsonWebEncryptionEnc {
838
867
fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
839
868
where
@@ -844,7 +873,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebEncryptionEnc {
844
873
}
845
874
}
846
875
847
- #[ cfg( feature = "serde" ) ]
848
876
impl serde:: Serialize for JsonWebEncryptionEnc {
849
877
fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
850
878
where
@@ -854,7 +882,6 @@ impl serde::Serialize for JsonWebEncryptionEnc {
854
882
}
855
883
}
856
884
857
- #[ cfg( feature = "schemars" ) ]
858
885
impl schemars:: JsonSchema for JsonWebEncryptionEnc {
859
886
fn schema_name ( ) -> String {
860
887
"JsonWebEncryptionEnc" . to_owned ( )
@@ -992,7 +1019,6 @@ impl core::str::FromStr for JsonWebEncryptionCompressionAlgorithm {
992
1019
}
993
1020
}
994
1021
995
- #[ cfg( feature = "serde" ) ]
996
1022
impl < ' de > serde:: Deserialize < ' de > for JsonWebEncryptionCompressionAlgorithm {
997
1023
fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
998
1024
where
@@ -1003,7 +1029,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebEncryptionCompressionAlgorithm {
1003
1029
}
1004
1030
}
1005
1031
1006
- #[ cfg( feature = "serde" ) ]
1007
1032
impl serde:: Serialize for JsonWebEncryptionCompressionAlgorithm {
1008
1033
fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
1009
1034
where
@@ -1013,7 +1038,6 @@ impl serde::Serialize for JsonWebEncryptionCompressionAlgorithm {
1013
1038
}
1014
1039
}
1015
1040
1016
- #[ cfg( feature = "schemars" ) ]
1017
1041
impl schemars:: JsonSchema for JsonWebEncryptionCompressionAlgorithm {
1018
1042
fn schema_name ( ) -> String {
1019
1043
"JsonWebEncryptionCompressionAlgorithm" . to_owned ( )
@@ -1101,7 +1125,6 @@ impl core::str::FromStr for JsonWebKeyType {
1101
1125
}
1102
1126
}
1103
1127
1104
- #[ cfg( feature = "serde" ) ]
1105
1128
impl < ' de > serde:: Deserialize < ' de > for JsonWebKeyType {
1106
1129
fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
1107
1130
where
@@ -1112,7 +1135,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebKeyType {
1112
1135
}
1113
1136
}
1114
1137
1115
- #[ cfg( feature = "serde" ) ]
1116
1138
impl serde:: Serialize for JsonWebKeyType {
1117
1139
fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
1118
1140
where
@@ -1122,7 +1144,6 @@ impl serde::Serialize for JsonWebKeyType {
1122
1144
}
1123
1145
}
1124
1146
1125
- #[ cfg( feature = "schemars" ) ]
1126
1147
impl schemars:: JsonSchema for JsonWebKeyType {
1127
1148
fn schema_name ( ) -> String {
1128
1149
"JsonWebKeyType" . to_owned ( )
@@ -1249,7 +1270,6 @@ impl core::str::FromStr for JsonWebKeyEcEllipticCurve {
1249
1270
}
1250
1271
}
1251
1272
1252
- #[ cfg( feature = "serde" ) ]
1253
1273
impl < ' de > serde:: Deserialize < ' de > for JsonWebKeyEcEllipticCurve {
1254
1274
fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
1255
1275
where
@@ -1260,7 +1280,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebKeyEcEllipticCurve {
1260
1280
}
1261
1281
}
1262
1282
1263
- #[ cfg( feature = "serde" ) ]
1264
1283
impl serde:: Serialize for JsonWebKeyEcEllipticCurve {
1265
1284
fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
1266
1285
where
@@ -1270,7 +1289,6 @@ impl serde::Serialize for JsonWebKeyEcEllipticCurve {
1270
1289
}
1271
1290
}
1272
1291
1273
- #[ cfg( feature = "schemars" ) ]
1274
1292
impl schemars:: JsonSchema for JsonWebKeyEcEllipticCurve {
1275
1293
fn schema_name ( ) -> String {
1276
1294
"JsonWebKeyEcEllipticCurve" . to_owned ( )
@@ -1397,7 +1415,6 @@ impl core::str::FromStr for JsonWebKeyOkpEllipticCurve {
1397
1415
}
1398
1416
}
1399
1417
1400
- #[ cfg( feature = "serde" ) ]
1401
1418
impl < ' de > serde:: Deserialize < ' de > for JsonWebKeyOkpEllipticCurve {
1402
1419
fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
1403
1420
where
@@ -1408,7 +1425,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebKeyOkpEllipticCurve {
1408
1425
}
1409
1426
}
1410
1427
1411
- #[ cfg( feature = "serde" ) ]
1412
1428
impl serde:: Serialize for JsonWebKeyOkpEllipticCurve {
1413
1429
fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
1414
1430
where
@@ -1418,7 +1434,6 @@ impl serde::Serialize for JsonWebKeyOkpEllipticCurve {
1418
1434
}
1419
1435
}
1420
1436
1421
- #[ cfg( feature = "schemars" ) ]
1422
1437
impl schemars:: JsonSchema for JsonWebKeyOkpEllipticCurve {
1423
1438
fn schema_name ( ) -> String {
1424
1439
"JsonWebKeyOkpEllipticCurve" . to_owned ( )
@@ -1535,7 +1550,6 @@ impl core::str::FromStr for JsonWebKeyUse {
1535
1550
}
1536
1551
}
1537
1552
1538
- #[ cfg( feature = "serde" ) ]
1539
1553
impl < ' de > serde:: Deserialize < ' de > for JsonWebKeyUse {
1540
1554
fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
1541
1555
where
@@ -1546,7 +1560,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebKeyUse {
1546
1560
}
1547
1561
}
1548
1562
1549
- #[ cfg( feature = "serde" ) ]
1550
1563
impl serde:: Serialize for JsonWebKeyUse {
1551
1564
fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
1552
1565
where
@@ -1556,7 +1569,6 @@ impl serde::Serialize for JsonWebKeyUse {
1556
1569
}
1557
1570
}
1558
1571
1559
- #[ cfg( feature = "schemars" ) ]
1560
1572
impl schemars:: JsonSchema for JsonWebKeyUse {
1561
1573
fn schema_name ( ) -> String {
1562
1574
"JsonWebKeyUse" . to_owned ( )
@@ -1677,7 +1689,6 @@ impl core::str::FromStr for JsonWebKeyOperation {
1677
1689
}
1678
1690
}
1679
1691
1680
- #[ cfg( feature = "serde" ) ]
1681
1692
impl < ' de > serde:: Deserialize < ' de > for JsonWebKeyOperation {
1682
1693
fn deserialize < D > ( deserializer : D ) -> Result < Self , D :: Error >
1683
1694
where
@@ -1688,7 +1699,6 @@ impl<'de> serde::Deserialize<'de> for JsonWebKeyOperation {
1688
1699
}
1689
1700
}
1690
1701
1691
- #[ cfg( feature = "serde" ) ]
1692
1702
impl serde:: Serialize for JsonWebKeyOperation {
1693
1703
fn serialize < S > ( & self , serializer : S ) -> Result < S :: Ok , S :: Error >
1694
1704
where
@@ -1698,7 +1708,6 @@ impl serde::Serialize for JsonWebKeyOperation {
1698
1708
}
1699
1709
}
1700
1710
1701
- #[ cfg( feature = "schemars" ) ]
1702
1711
impl schemars:: JsonSchema for JsonWebKeyOperation {
1703
1712
fn schema_name ( ) -> String {
1704
1713
"JsonWebKeyOperation" . to_owned ( )
0 commit comments