-
Notifications
You must be signed in to change notification settings - Fork 176
Expand file tree
/
Copy pathlib.rs
More file actions
107 lines (86 loc) · 3.45 KB
/
lib.rs
File metadata and controls
107 lines (86 loc) · 3.45 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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
#![no_std]
#![cfg_attr(docsrs, feature(doc_cfg))]
#![doc = include_str!("../README.md")]
#![doc(
html_logo_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg",
html_favicon_url = "https://raw.githubusercontent.com/RustCrypto/media/6ee8e381/logo.svg"
)]
#![forbid(unsafe_code)]
#![warn(
clippy::mod_module_files,
clippy::unwrap_used,
missing_docs,
rust_2018_idioms,
unused_qualifications
)]
extern crate alloc;
pub mod pbe_params;
pub mod pfx;
pub mod safe_bag;
#[cfg(feature = "kdf")]
pub mod kdf;
#[cfg(feature = "encryption")]
mod decrypt;
mod authenticated_safe;
mod bag_type;
mod cert_type;
mod crl_type;
mod digest_info;
mod mac_data;
pub use crate::{
authenticated_safe::AuthenticatedSafe,
bag_type::BagType,
cert_type::{CertBag, CertTypes},
crl_type::{CrlBag, CrlTypes},
digest_info::DigestInfo,
mac_data::MacData,
pfx::Pfx,
safe_bag::SafeBag,
};
pub use cms;
use const_oid::ObjectIdentifier;
// pbe oids
/// `pbeWithSHAAnd128BitRC4` Object Identifier (OID).
pub const PKCS_12_PBE_WITH_SHAAND128_BIT_RC4: ObjectIdentifier =
ObjectIdentifier::new_unwrap("1.2.840.113549.1.12.1.1");
/// `pbeWithSHAAnd40BitRC4` Object Identifier (OID).
pub const PKCS_12_PBE_WITH_SHAAND40_BIT_RC4: ObjectIdentifier =
ObjectIdentifier::new_unwrap("1.2.840.113549.1.12.1.2");
/// `pbeWithSHAAnd3-KeyTripleDES-CBC` Object Identifier (OID).
pub const PKCS_12_PBE_WITH_SHAAND3_KEY_TRIPLE_DES_CBC: ObjectIdentifier =
ObjectIdentifier::new_unwrap("1.2.840.113549.1.12.1.3");
/// `pbeWithSHAAnd2-KeyTripleDES-CBC` Object Identifier (OID).
pub const PKCS_12_PBE_WITH_SHAAND2_KEY_TRIPLE_DES_CBC: ObjectIdentifier =
ObjectIdentifier::new_unwrap("1.2.840.113549.1.12.1.4");
/// `pbeWithSHAAnd128BitRC2-CBC` Object Identifier (OID).
pub const PKCS_12_PBE_WITH_SHAAND128_BIT_RC2_CBC: ObjectIdentifier =
ObjectIdentifier::new_unwrap("1.2.840.113549.1.12.1.5");
/// `pbeWithSHAAnd40BitRC2-CBC` Object Identifier (OID).
pub const PKCS_12_PBE_WITH_SHAAND40_BIT_RC2_CBC: ObjectIdentifier =
ObjectIdentifier::new_unwrap("1.2.840.113549.1.12.1.6");
// bag types
/// `pkcs-12 keyBag` Object Identifier (OID).
pub const PKCS_12_KEY_BAG_OID: ObjectIdentifier =
ObjectIdentifier::new_unwrap("1.2.840.113549.1.12.10.1.1");
/// `pkcs-12 pkcs8ShroudedKeyBag` Object Identifier (OID).
pub const PKCS_12_PKCS8_KEY_BAG_OID: ObjectIdentifier =
ObjectIdentifier::new_unwrap("1.2.840.113549.1.12.10.1.2");
/// `pkcs-12 certBag` Object Identifier (OID).
pub const PKCS_12_CERT_BAG_OID: ObjectIdentifier =
ObjectIdentifier::new_unwrap("1.2.840.113549.1.12.10.1.3");
/// `pkcs-12 crlBag` Object Identifier (OID).
pub const PKCS_12_CRL_BAG_OID: ObjectIdentifier =
ObjectIdentifier::new_unwrap("1.2.840.113549.1.12.10.1.4");
/// `pkcs-12 secretBag` Object Identifier (OID).
pub const PKCS_12_SECRET_BAG_OID: ObjectIdentifier =
ObjectIdentifier::new_unwrap("1.2.840.113549.1.12.10.1.5");
/// `pkcs-12 safeContentsBag` Object Identifier (OID).
pub const PKCS_12_SAFE_CONTENTS_BAG_OID: ObjectIdentifier =
ObjectIdentifier::new_unwrap("1.2.840.113549.1.12.10.1.6");
// cert types
/// `pkcs-9 x509Certificate for pkcs-12` Object Identifier (OID).
pub const PKCS_12_X509_CERT_OID: ObjectIdentifier =
ObjectIdentifier::new_unwrap("1.2.840.113549.1.9.22.1");
/// `pkcs-9 sdsiCertificate for pkcs-12` Object Identifier (OID).
pub const PKCS_12_SDSI_CERT_OID: ObjectIdentifier =
ObjectIdentifier::new_unwrap("1.2.840.113549.1.9.22.2");