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
//! BDEW MaKo AS4 profile for German energy market communication.
//!
//! This crate encodes the **BDEW AS4 Kommunikationshandbuch** requirements on top
//! of [`asx_rs`](https://docs.rs/asx-rs), providing:
//!
//! - [`constants`] — BDEW-specific URIs, algorithm identifiers, and retry parameters
//! - [`pmode`] — [`BdewAction`] enum + [`bdew_pmode`] / [`bdew_pmode_encrypted`] factory functions
//! - [`profile`] — [`BdewAs4Profile`] entry point + [`bdew_mako_profile_stack`]
//!
//! ## BDEW AS4 requirements
//!
//! | Requirement | Specification |
//! |---|---|
//! | Transport | HTTPS + mutual TLS (TLS 1.2 minimum) |
//! | SOAP version | 1.2 |
//! | MEP | One-Way/Push (mandatory) |
//! | Signing | RSA-SHA256 + Exclusive C14N + SHA-256 digest — **mandatory** |
//! | Encryption | AES-128-CBC or AES-256-GCM + RSA-OAEP — **optional** |
//! | Party ID | 13-digit GLN, type `urn:oasis:names:tc:ebcore:partyid-type:iso6523:0088` |
//! | Retry window | 72 hours, up to 5 attempts |
//! | Deduplication | Required (persistent `asx_rs::storage::TtlDedupStorage`) |
//!
//! AS4 became mandatory for electricity market communication on **1 April 2024**
//! and for gas market communication on **1 April 2025**
//! (BNetzA order BK6-22-024 / BK7-22-023).
//!
//! ## 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 ──────────────────────────────────────
pub use ;
pub use ;
pub use ;
pub use bdew_router_config;