-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathverify.rs
More file actions
46 lines (43 loc) · 1.42 KB
/
verify.rs
File metadata and controls
46 lines (43 loc) · 1.42 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
use rustls::crypto::WebPkiSupportedAlgorithms;
use rustls::SignatureScheme;
use self::ecdsa::{ECDSA_P256_SHA256, ECDSA_P256_SHA384, ECDSA_P384_SHA256, ECDSA_P384_SHA384};
use self::eddsa::ED25519;
use self::rsa::{
RSA_PKCS1_SHA256, RSA_PKCS1_SHA384, RSA_PKCS1_SHA512, RSA_PSS_SHA256, RSA_PSS_SHA384,
RSA_PSS_SHA512,
};
pub const ALGORITHMS: WebPkiSupportedAlgorithms = WebPkiSupportedAlgorithms {
all: &[
ECDSA_P256_SHA256,
ECDSA_P256_SHA384,
ECDSA_P384_SHA256,
ECDSA_P384_SHA384,
ED25519,
RSA_PKCS1_SHA256,
RSA_PKCS1_SHA384,
RSA_PKCS1_SHA512,
RSA_PSS_SHA256,
RSA_PSS_SHA384,
RSA_PSS_SHA512,
],
mapping: &[
(
SignatureScheme::ECDSA_NISTP384_SHA384,
&[ECDSA_P384_SHA384, ECDSA_P256_SHA384],
),
(
SignatureScheme::ECDSA_NISTP256_SHA256,
&[ECDSA_P256_SHA256, ECDSA_P384_SHA256],
),
(SignatureScheme::ED25519, &[ED25519]),
(SignatureScheme::RSA_PKCS1_SHA256, &[RSA_PKCS1_SHA256]),
(SignatureScheme::RSA_PKCS1_SHA384, &[RSA_PKCS1_SHA384]),
(SignatureScheme::RSA_PKCS1_SHA512, &[RSA_PKCS1_SHA512]),
(SignatureScheme::RSA_PSS_SHA256, &[RSA_PSS_SHA256]),
(SignatureScheme::RSA_PSS_SHA384, &[RSA_PSS_SHA384]),
(SignatureScheme::RSA_PSS_SHA512, &[RSA_PSS_SHA512]),
],
};
pub mod ecdsa;
pub mod eddsa;
pub mod rsa;