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
//! BDEW MaKo AS4 profile for German energy market communication.
//!
//! This crate encodes the **BDEW AS4-Profil v1.2** requirements on top
//! of [`asx_rs`](https://docs.rs/asx-rs) v0.7, providing:
//!
//! - [`constants`] — BDEW-specific URIs and algorithm identifiers
//! - [`pmode`] — [`BdewAction`] enum, [`bdew_pmode`] / [`bdew_pmode_sign_only`],
//! - [`profile`] — [`BdewAs4Profile`], [`bdew_mako_profile_stack`],
//! [`bdew_push_policy`] (inbound policy with `require_encrypted_inbound`)
//! - [`testing`] *(feature)* — [`BdewTestPki`], [`MockAs4Endpoint`],
//! [`generate_self_signed_bdew_keypair`] (BrainpoolP256r1)
//!
//! ## BDEW AS4-Profil v1.2 crypto requirements
//!
//! | Requirement | Algorithm | Source |
//! |---|---|---|
//! | Signing | **ECDSA-SHA256 + BrainpoolP256r1** | §2.2.6.2.1 / BSI TR-03116-3 §9.1 |
//! | Signing token | **X509PKIPathv1** (`BinarySecurityToken`) | §2.2.6.2.1 |
//! | Encryption | **ECDH-ES + ConcatKDF + AES-128-GCM** | §2.2.6.2.2 / BSI TR-03116-3 §9.2 |
//! | Key reference | **X509SKI** | §2.2.6.2.2 |
//! | EC curve | **BrainpoolP256r1** (both signing and encryption) | BSI TR-03116-3 |
//!
//! Both algorithms are **auto-detected** by asx-rs v0.7 from the key/cert type —
//! supply EC (BrainpoolP256r1) material and the correct paths are selected automatically.
//!
//! ## Quick start
//!
//! ```rust
//! use mako_as4::{BdewAs4Profile, BdewAction, bdew_pmode, constants};
//!
//! // Build a profile and register bilateral P-Modes for each trading partner
//! let mut profile = BdewAs4Profile::new();
//! profile
//! .register_pmode(bdew_pmode("pm-utilmd-a", "9900000000001", BdewAction::Utilmd))
//! .register_pmode(bdew_pmode("pm-aperak-a", "9900000000001", BdewAction::Aperak));
//!
//! // Fail-fast at startup
//! profile.validate().expect("BDEW MaKo profile must satisfy all security invariants");
//!
//! // Resolve a P-Mode at send time
//! let pm = profile.resolve_pmode(
//! "9900000000001",
//! constants::SERVICE,
//! &BdewAction::Utilmd.as_uri(),
//! );
//! assert!(pm.is_some());
//! ```
// ── Top-level re-exports for ergonomics ──────────────────────────────────────
/// Re-export `InsecureBypassAs4Verifier` for test-only AS4 receive without PKI.
pub use InsecureBypassAs4Verifier;
pub use ;
pub use ;
pub use ;
pub use bdew_router_config;
pub use ;