cmpv2/
parameter.rs

1//! Parameter types
2
3use der::asn1::OctetString;
4use der::Sequence;
5
6use spki::AlgorithmIdentifierOwned;
7
8/// The `PBMParameter` type is defined in [RFC 4210 Section 5.1.3.1].
9///
10/// ```text
11/// PBMParameter ::= SEQUENCE {
12///     salt                OCTET STRING,
13///     owf                 AlgorithmIdentifier{DIGEST-ALGORITHM, {...}},
14///     iterationCount      INTEGER,
15///     mac                 AlgorithmIdentifier{MAC-ALGORITHM, {...}}
16/// }
17/// ```
18///
19/// [RFC 4210 Section 5.1.3.1]: https://www.rfc-editor.org/rfc/rfc4210#section-5.1.3.1
20#[derive(Clone, Debug, Eq, PartialEq, Sequence)]
21#[allow(missing_docs)]
22pub struct PbmParameter {
23    pub salt: OctetString,
24    pub owf: AlgorithmIdentifierOwned,
25    pub iteration_count: u64,
26    pub mac: AlgorithmIdentifierOwned,
27}
28
29/// The `PBMParameter` type is defined in [RFC 4210 Section 5.1.3.2].
30///
31/// ```text
32/// DHBMParameter ::= SEQUENCE {
33///     owf                 AlgorithmIdentifier{DIGEST-ALGORITHM, {...}},
34///     mac                 AlgorithmIdentifier{MAC-ALGORITHM, {...}}
35/// }
36/// ```
37///
38/// [RFC 4210 Section 5.1.3.2]: https://www.rfc-editor.org/rfc/rfc4210#section-5.1.3.2
39#[derive(Clone, Debug, Eq, PartialEq, Sequence)]
40#[allow(missing_docs)]
41pub struct DhbmParameter {
42    pub owf: AlgorithmIdentifierOwned,
43    pub mac: AlgorithmIdentifierOwned,
44}