@@ -49,6 +49,10 @@ impl fmt::Debug for SignatureAlgorithm {
49
49
write ! ( f, "PKCS_RSA_SHA512" )
50
50
} else if self == & PKCS_RSA_PSS_SHA256 {
51
51
write ! ( f, "PKCS_RSA_PSS_SHA256" )
52
+ } else if self == & PKCS_RSA_PSS_SHA384 {
53
+ write ! ( f, "PKCS_RSA_PSS_SHA384" )
54
+ } else if self == & PKCS_RSA_PSS_SHA512 {
55
+ write ! ( f, "PKCS_RSA_PSS_SHA512" )
52
56
} else if self == & PKCS_ECDSA_P256_SHA256 {
53
57
write ! ( f, "PKCS_ECDSA_P256_SHA256" )
54
58
} else if self == & PKCS_ECDSA_P384_SHA384 {
@@ -89,6 +93,8 @@ impl SignatureAlgorithm {
89
93
& PKCS_RSA_SHA384 ,
90
94
& PKCS_RSA_SHA512 ,
91
95
& PKCS_RSA_PSS_SHA256 ,
96
+ & PKCS_RSA_PSS_SHA384 ,
97
+ & PKCS_RSA_PSS_SHA512 ,
92
98
& PKCS_ECDSA_P256_SHA256 ,
93
99
& PKCS_ECDSA_P384_SHA384 ,
94
100
#[ cfg( feature = "aws_lc_rs" ) ]
@@ -166,6 +172,48 @@ pub(crate) mod algo {
166
172
} ,
167
173
} ;
168
174
175
+ /// RSA signing with PKCS#1 2.1 RSASSA-PSS padding and SHA-384 hashing as per [RFC 4055](https://tools.ietf.org/html/rfc4055)
176
+ ///
177
+ /// Note: `*ring*` does not support this signature algorithm, and so it can not be used with the `crypto` feature
178
+ /// of `rcgen` when verifying signatures using the `ring` backend.
179
+ pub static PKCS_RSA_PSS_SHA384 : SignatureAlgorithm = SignatureAlgorithm {
180
+ // We could also use RSA_ENCRYPTION here, but it's recommended
181
+ // to use ID-RSASSA-PSS if possible.
182
+ oids_sign_alg : & [ & RSASSA_PSS_SHA384 ] ,
183
+ #[ cfg( feature = "crypto" ) ]
184
+ sign_alg : SignAlgo :: Rsa ( & signature:: RSA_PSS_SHA384 ) ,
185
+ oid_components : RSASSA_PSS_SHA384 , //&[1, 2, 840, 113549, 1, 1, 12],
186
+ // rSASSA-PSS-SHA384-Params in RFC 4055
187
+ params : SignatureAlgorithmParams :: RsaPss {
188
+ // id-sha384 in https://datatracker.ietf.org/doc/html/rfc4055#section-2.1
189
+ hash_algorithm : & [ 2 , 16 , 840 , 1 , 101 , 3 , 4 , 2 , 2 ] ,
190
+ // It's conventional to use a salt length equal to the size of the hash algorithm's digest
191
+ // (48 bytes for the 384 bit digest produced by SHA384).
192
+ salt_length : 48 ,
193
+ } ,
194
+ } ;
195
+
196
+ /// RSA signing with PKCS#1 2.1 RSASSA-PSS padding and SHA-512 hashing as per [RFC 4055](https://tools.ietf.org/html/rfc4055)
197
+ ///
198
+ /// Note: `*ring*` does not support this signature algorithm, and so it can not be used with the `crypto` feature
199
+ /// of `rcgen` when verifying signatures using the `ring` backend.
200
+ pub static PKCS_RSA_PSS_SHA512 : SignatureAlgorithm = SignatureAlgorithm {
201
+ // We could also use RSA_ENCRYPTION here, but it's recommended
202
+ // to use ID-RSASSA-PSS if possible.
203
+ oids_sign_alg : & [ & RSASSA_PSS_SHA512 ] ,
204
+ #[ cfg( feature = "crypto" ) ]
205
+ sign_alg : SignAlgo :: Rsa ( & signature:: RSA_PSS_SHA512 ) ,
206
+ oid_components : RSASSA_PSS_SHA512 , //&[1, 2, 840, 113549, 1, 1, 13],
207
+ // rSASSA-PSS-SHA512-Params in RFC 4055
208
+ params : SignatureAlgorithmParams :: RsaPss {
209
+ // id-sha512 in https://datatracker.ietf.org/doc/html/rfc4055#section-2.1
210
+ hash_algorithm : & [ 2 , 16 , 840 , 1 , 101 , 3 , 4 , 2 , 3 ] ,
211
+ // It's conventional to use a salt length equal to the size of the hash algorithm's digest
212
+ // (64 bytes for the 512 bit digest produced by SHA512).
213
+ salt_length : 64 ,
214
+ } ,
215
+ } ;
216
+
169
217
/// ECDSA signing using the P-256 curves and SHA-256 hashing as per [RFC 5758](https://tools.ietf.org/html/rfc5758#section-3.2)
170
218
pub static PKCS_ECDSA_P256_SHA256 : SignatureAlgorithm = SignatureAlgorithm {
171
219
oids_sign_alg : & [ & EC_PUBLIC_KEY , & EC_SECP_256_R1 ] ,
0 commit comments