utility-pki 0.1.0

TLS and certificate profiles of the German energy sector (BDEW AS4, BSI TR-03116-3, BSI TR-02102-2) as Rust data: check sessions, SM-PKI certificates and OpenSSL configurations
Documentation
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
//! The profiles this crate ships, each checked table by table against its primary text.
//!
//! | Profile | Use it for |
//! |---|---|
//! | [`BDEW_AS4`] | German energy market communication over AS4 (Strom, Gas) |
//! | [`BSI_TR_03116_3`] | the smart metering PKI: WAN and market communication |
//! | [`BSI_TR_02102_2`] | general TLS; the crypto baseline for IEC 62443-4-2 CR 4.3 |
//!
//! **IEC 62443** sets no TLS parameters: CR 4.3 asks for "internationally recognized
//! and proven" cryptography and leaves the choice to the integrator. Use
//! [`BSI_TR_02102_2`] as that choice, and add what your security level asks for:
//!
//! ```
//! use utility_pki::profiles::BSI_TR_02102_2;
//! use utility_pki::{Profile, Revocation};
//!
//! // CR 1.2 / CR 3.1 RE(1) (SL 2+): authenticate devices; CR 1.9: check revocation.
//! const PLANT_NETWORK: Profile = Profile {
//!     id: "plant-sl2",
//!     name: "Plant network (IEC 62443 SL 2, TR-02102-2 crypto)",
//!     mutual_auth: true,
//!     revocation: Revocation::Required,
//!     ..BSI_TR_02102_2
//! };
//! ```

use core::time::Duration;

use crate::cert::{
    CertRules, CertSignature as Sig, ExtendedKeyUsage as Eku, Extension as X, KeyUsage, SanRules,
    SubjectRules,
};
use crate::ids::{CipherSuite as C, NamedGroup as G, SignatureScheme as S};
use crate::profile::{Allowed, Curve, KeyRule, Level, Profile, Revocation, VersionRules};

const HOURS_48: Duration = Duration::from_secs(48 * 3600);

// ---------------------------------------------------------------------------------------
// BSI TR-03116-3, Stand 2025 (13.12.2024), chapter 4
// ---------------------------------------------------------------------------------------

/// Tab. 7 (MUSS), Tab. 8 (SOLLTE): cipher suites.
const TR03116_TLS12_SUITES_MUST: &[C] =
    &[C::TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256, C::TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256];
const TR03116_TLS12_SUITES_SHOULD: &[C] =
    &[C::TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384, C::TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384];
/// Tab. 7 (MUSS), Tab. 8 (SOLLTE): curves.
const TR03116_TLS12_GROUPS: Allowed<G> = Allowed::Only {
    required: &[G::SECP256R1, G::BRAINPOOLP256R1, G::BRAINPOOLP384R1],
    optional: &[G::BRAINPOOLP512R1, G::SECP384R1],
};
/// §4.2.2.1, Tab. 9: ECDSA only, with SHA-256, SHA-384, SHA-512 (all MUSS).
const TR03116_TLS12_SIGS: Allowed<S> = Allowed::Only {
    required: &[S::ECDSA_SECP256R1_SHA256, S::ECDSA_SECP384R1_SHA384, S::ECDSA_SECP521R1_SHA512],
    optional: &[],
};
/// Tab. 11 (MUSS), Tab. 12 (SOLLTE).
const TR03116_TLS13_SUITES_MUST: &[C] = &[C::TLS_AES_128_GCM_SHA256];
const TR03116_TLS13_SUITES_SHOULD: &[C] = &[C::TLS_AES_256_GCM_SHA384, C::TLS_AES_128_CCM_SHA256];
/// Tab. 13 (MUSS), Tab. 14 (SOLLTE).
const TR03116_TLS13_GROUPS: Allowed<G> = Allowed::Only {
    required: &[G::BRAINPOOLP256R1_TLS13, G::BRAINPOOLP384R1_TLS13, G::SECP256R1],
    optional: &[G::BRAINPOOLP512R1_TLS13, G::SECP384R1],
};
/// Tab. 15: server signatures (MUSS, nothing else).
const TR03116_TLS13_SIGS: Allowed<S> = Allowed::Only {
    required: &[
        S::ECDSA_BRAINPOOLP256R1TLS13_SHA256,
        S::ECDSA_BRAINPOOLP384R1TLS13_SHA384,
        S::ECDSA_BRAINPOOLP512R1TLS13_SHA512,
        S::ECDSA_SECP256R1_SHA256,
        S::ECDSA_SECP384R1_SHA384,
    ],
    optional: &[],
};
/// Tab. 16: certificate signatures (MUSS, nothing else).
const TR03116_TLS13_CERT_SIGS: Allowed<S> = Allowed::Only {
    required: &[
        S::ECDSA_BRAINPOOLP256R1TLS13_SHA256,
        S::ECDSA_BRAINPOOLP384R1TLS13_SHA384,
        S::ECDSA_BRAINPOOLP512R1TLS13_SHA512,
    ],
    optional: &[],
};
/// The SM-PKI end-user TLS certificate, CTLS(ENu), for every role (GWA, GWH, EMT, SMGW).
const SM_PKI_TLS_CERT: CertRules = CertRules {
    // TR-03116-3 §4.1.1, Tab. 6; TR-03109-4 A.1.2 (id-ecPublicKey, namedCurve).
    keys: Allowed::Only { required: &[KeyRule::Ec(Curve::BrainpoolP256r1)], optional: &[] },
    // TR-03116-3 Tab. 5: Sub-CA signs with ecdsa-with-SHA256 (P256r1), from 2025 SHA384 (P384r1).
    signatures: Allowed::Only { required: &[], optional: &[Sig::EcdsaSha256, Sig::EcdsaSha384] },
    // TR-03109-4 Tab. 11: 2 years, GWA 3 years: role-dependent, so not limited here.
    max_validity_days: None,
    // TR-03109-4 A.2, Tab. 18/19: these and "weitere Zertifikats-Extensions sind nicht erlaubt".
    // SubjectAltName is "x" for the SMGW, so only optional here.
    extensions: Allowed::Only {
        required: &[
            X::AuthorityKeyIdentifier,
            X::SubjectKeyIdentifier,
            X::KeyUsage,
            X::CertificatePolicies,
            X::IssuerAltName,
            X::BasicConstraints,
            X::ExtendedKeyUsage,
            X::CrlDistributionPoints,
        ],
        optional: &[X::SubjectAltName],
    },
    // TR-03109-4 A.2 items 1–10: "Kritisch: Ja" for KU, BC, EKU; "Nein" for the others.
    critical: Some(&[X::KeyUsage, X::BasicConstraints, X::ExtendedKeyUsage]),
    // TR-03109-4 Tab. 22: CTLS(ENu) DigitalSignature.
    key_usage: &[KeyUsage::DigitalSignature],
    // TR-03109-4 Tab. 26: clientAuth for every role, serverAuth for all but the SMGW.
    extended_key_usage: Allowed::Only { required: &[Eku::ClientAuth], optional: &[Eku::ServerAuth] },
    // TR-03109-4 Tab. 25: cA FALSE.
    end_entity: true,
    // CP SM-PKI A.7.1: DNS name with serverAuth, at most 20, no wildcards.
    san: SanRules { wildcards: false, max_dns_names: Some(20), dns_name_for_server_auth: true, uris: None },
    // CP SM-PKI Tab. 20–27: O "SM-PKI-DE" for every role (the test PKI uses "SM-Test-PKI-DE").
    subject: SubjectRules {
        organization: Some("SM-PKI-DE"),
        organizational_unit: false,
        common_name_contains: None,
    },
};

const TR03116_TLS12: VersionRules = VersionRules {
    support: Level::Must,
    cipher_suites: Allowed::Only {
        required: TR03116_TLS12_SUITES_MUST,
        optional: TR03116_TLS12_SUITES_SHOULD,
    },
    groups: TR03116_TLS12_GROUPS,
    signature_schemes: TR03116_TLS12_SIGS,
    cert_signature_schemes: TR03116_TLS12_SIGS,
};
const TR03116_TLS13: VersionRules = VersionRules {
    support: Level::Should,
    cipher_suites: Allowed::Only {
        required: TR03116_TLS13_SUITES_MUST,
        optional: TR03116_TLS13_SUITES_SHOULD,
    },
    groups: TR03116_TLS13_GROUPS,
    signature_schemes: TR03116_TLS13_SIGS,
    cert_signature_schemes: TR03116_TLS13_CERT_SIGS,
};

/// BSI TR-03116-3: TLS between participants of the smart metering PKI, in the WAN
/// (gateway administrator, external market participants) and in market communication.
pub const BSI_TR_03116_3: Profile = Profile {
    id: "bsi-tr-03116-3",
    name: "BSI TR-03116-3",
    sources: &[
        "BSI TR-03116-3, Stand 2025 (13.12.2024), Tab. 5, Kap. 4, Tab. 6–16",
        "BSI TR-03109-4 1.2.1 (09.08.2017), Anhang A (CTLS end-user certificates)",
        "BSI Certificate Policy SM-PKI 1.1.2 (25.01.2023), Anhang A",
    ],
    // §4.1.2: TLS 1.2 MUSS, TLS 1.3 EMPFOHLEN, nothing older.
    tls12: Some(TR03116_TLS12),
    tls13: Some(TR03116_TLS13),
    cert: SM_PKI_TLS_CERT,
    // §4.1.1: "Zur gegenseitigen Authentifizierung MUSS jede Partei ein TLS-Zertifikat aus
    // der SM-PKI ... verwenden".
    mutual_auth: true,
    // Kap. 3: verification per the SM-PKI certificate policy, which has CRLs only.
    revocation: Revocation::CrlRequired,
    max_session_lifetime: Some(HOURS_48),
    encrypt_then_mac: Level::Must,
    extended_master_secret: Level::Should,
    renegotiation: Level::MustNot,
    early_data: Level::MustNot,
    sni: Level::May,
    notes: &[
        "§4.1.2: a session, resumptions included, ends after at most 48 hours; then a full handshake",
        "§4.1.2: resumption, also RFC 5077 tickets, is allowed within that time; ticket keys rotated and destroyed",
        "§4.2.1: clients announce curves as named curves; both sides use ec_point_formats (RFC 8422)",
        "§4.2.2.2: no truncated HMAC; Encrypt-then-MAC is mandatory from 2025 (server picks GCM or uses EtM)",
        "§4.3: TLS 1.3 handshake modes ECDHE, and PSK with ECDHE for resumption only",
        "Tab. 5: the chain is signed with ECDSA on brainpoolP256r1/P384r1; every party must verify both",
    ],
};

// ---------------------------------------------------------------------------------------
// BDEW AS4
// ---------------------------------------------------------------------------------------

/// BDEW AS4: market communication in the German energy sector (Strom, Gas). TLS per
/// TR-03116-3, with every recommended suite made mandatory, SNI, and SM-PKI certificates.
pub const BDEW_AS4: Profile = Profile {
    id: "bdew-as4",
    name: "BDEW AS4",
    sources: &[
        "BDEW AS4-Profil 1.2 (01.04.2026, gültig ab 01.10.2026), Kap. 2.2.6.1, 2.3.4.4",
        "BDEW Regelungen zum Übertragungsweg AS4 2.6 (01.04.2026), Kap. 3, 5",
        "BSI TR-03116-3, Stand 2025 (13.12.2024), Kap. 4",
        "BSI TR-03109-4 1.2.1 (09.08.2017), Tab. 11, Anhang A",
        "BSI Certificate Policy SM-PKI 1.1.2 (25.01.2023), Kap. 4.9, Tab. 22, 23, Anhang A.7.1",
    ],
    // AS4-Profil 2.2.6.1: "Es MUSS die Cipher Suites unterstützen, die empfohlen werden in
    // [TR03116-3] (Abschnitt 4)": the SOLLTE suites of Tab. 8 and 12 become MUSS.
    tls12: Some(VersionRules {
        support: Level::Must,
        cipher_suites: Allowed::Only {
            required: &[
                C::TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
                C::TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
                C::TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,
                C::TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
            ],
            optional: &[],
        },
        ..TR03116_TLS12
    }),
    tls13: Some(VersionRules {
        support: Level::Should,
        cipher_suites: Allowed::Only {
            required: &[C::TLS_AES_128_GCM_SHA256, C::TLS_AES_256_GCM_SHA384, C::TLS_AES_128_CCM_SHA256],
            optional: &[],
        },
        ..TR03116_TLS13
    }),
    // The market participant's CTLS(EMT): the SM-PKI certificate, narrowed.
    cert: CertRules {
        // TR-03109-4 Tab. 11: "Andere Endnutzerzertifikate (TLS/Sign/Enc): 2 Jahre". Two
        // years that span a leap day are 731 days.
        max_validity_days: Some(731),
        // TR-03109-4 Tab. 18: SubjectAltNames "m" for C(EMT).
        extensions: Allowed::Only {
            required: &[
                X::AuthorityKeyIdentifier,
                X::SubjectKeyIdentifier,
                X::KeyUsage,
                X::CertificatePolicies,
                X::SubjectAltName,
                X::IssuerAltName,
                X::BasicConstraints,
                X::ExtendedKeyUsage,
                X::CrlDistributionPoints,
            ],
            optional: &[],
        },
        // TR-03109-4 Tab. 26: CTLS(EMT) serverAuth and clientAuth.
        extended_key_usage: Allowed::Only { required: &[Eku::ServerAuth, Eku::ClientAuth], optional: &[] },
        // RzÜ AS4 §5.2: exactly one URI, the AS4 endpoint; CP A.7.1 for the rest.
        san: SanRules { uris: Some(1), ..SM_PKI_TLS_CERT.san },
        // CP Tab. 23: CN "<org>.EMT.MAK[<extension>]", OU = Marktpartner-ID (mandatory).
        subject: SubjectRules {
            organization: Some("SM-PKI-DE"),
            organizational_unit: true,
            common_name_contains: Some(".EMT.MAK"),
        },
        ..SM_PKI_TLS_CERT
    },
    // RzÜ AS4 Kap. 3: SNI "ist zu unterstützen und muss verwendet werden".
    sni: Level::Must,
    notes: &[
        "AS4-Profil 2.2.6.1: client authentication required; rules apply wherever TLS terminates",
        "AS4-Profil 2.3.4.4: separate EC key pairs for TLS, signature and encryption, all from the SM-PKI",
        "AS4-Profil 2.3.4.4: the MP-ID is in the subject and equals the PartyId",
        "RzÜ AS4 5.2: the AS4 endpoint is the single URI in the SubjectAltName",
        "CP SM-PKI A.7.1: no wildcards in the SubjectAltName",
        "RzÜ AS4 5.4: CRL only; a CRL unreachable for 3 days means distrusting its CA until a new one is out",
        "RzÜ AS4 5.3: publish the successor certificate at least 10 working days before expiry",
    ],
    ..BSI_TR_03116_3
};

// ---------------------------------------------------------------------------------------
// BSI TR-02102-2, version 2026-01
// ---------------------------------------------------------------------------------------

/// TR-02102-2 recommends; it does not require. So every item is optional and nothing
/// outside the tables is recommended.
const fn recommended<T>(items: &'static [T]) -> Allowed<T> {
    Allowed::Only { required: &[], optional: items }
}

/// Tab. 11 (and Tab. 12 without the rsa_pkcs1 schemes, recommended only up to 2025).
const TR02102_TLS13_SIGS: &[S] = &[
    S::ECDSA_SECP256R1_SHA256,
    S::ECDSA_SECP384R1_SHA384,
    S::ECDSA_SECP521R1_SHA512,
    S::ECDSA_BRAINPOOLP256R1TLS13_SHA256,
    S::ECDSA_BRAINPOOLP384R1TLS13_SHA384,
    S::ECDSA_BRAINPOOLP512R1TLS13_SHA512,
    S::RSA_PSS_RSAE_SHA256,
    S::RSA_PSS_RSAE_SHA384,
    S::RSA_PSS_RSAE_SHA512,
    S::RSA_PSS_PSS_SHA256,
    S::RSA_PSS_PSS_SHA384,
    S::RSA_PSS_PSS_SHA512,
];
/// Tab. 7 and 8: ECDSA with SHA-2; RSA-PSS per Tab. 11 (note to Tab. 7).
const TR02102_TLS12_SIGS: &[S] = &[
    S::ECDSA_SECP256R1_SHA256,
    S::ECDSA_SECP384R1_SHA384,
    S::ECDSA_SECP521R1_SHA512,
    S::RSA_PSS_RSAE_SHA256,
    S::RSA_PSS_RSAE_SHA384,
    S::RSA_PSS_RSAE_SHA512,
    S::RSA_PSS_PSS_SHA256,
    S::RSA_PSS_PSS_SHA384,
    S::RSA_PSS_PSS_SHA512,
];

/// BSI TR-02102-2: the German federal recommendation for TLS, at a 120-bit security
/// level. Certificate-based TLS; use it wherever a standard asks for "state of the art"
/// cryptography, such as IEC 62443-4-2 CR 4.3.
pub const BSI_TR_02102_2: Profile = Profile {
    id: "bsi-tr-02102-2",
    name: "BSI TR-02102-2",
    sources: &["BSI TR-02102-2, version 2026-01 (27.01.2026), Tab. 2–14"],
    // Tab. 2: TLS 1.2 up to 2031, TLS 1.3 2032+ and preferred.
    tls12: Some(VersionRules {
        support: Level::May,
        // Tab. 3, without TLS_DHE_DSS (DSA is left out, see notes). Tab. 4 (static DH, up to
        // 2026) and Tab. 5 (PSK) are left out.
        cipher_suites: recommended(&[
            C::TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256,
            C::TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,
            C::TLS_ECDHE_ECDSA_WITH_AES_128_CCM,
            C::TLS_ECDHE_ECDSA_WITH_AES_256_CCM,
            C::TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256,
            C::TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA384,
            C::TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256,
            C::TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384,
            C::TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256,
            C::TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384,
            C::TLS_DHE_RSA_WITH_AES_128_GCM_SHA256,
            C::TLS_DHE_RSA_WITH_AES_256_GCM_SHA384,
            C::TLS_DHE_RSA_WITH_AES_128_CCM,
            C::TLS_DHE_RSA_WITH_AES_256_CCM,
            C::TLS_DHE_RSA_WITH_AES_128_CBC_SHA256,
            C::TLS_DHE_RSA_WITH_AES_256_CBC_SHA256,
        ]),
        // Tab. 6.
        groups: recommended(&[
            G::SECP256R1,
            G::SECP384R1,
            G::SECP521R1,
            G::BRAINPOOLP256R1,
            G::BRAINPOOLP384R1,
            G::BRAINPOOLP512R1,
            G::FFDHE3072,
            G::FFDHE4096,
        ]),
        signature_schemes: recommended(TR02102_TLS12_SIGS),
        cert_signature_schemes: recommended(TR02102_TLS12_SIGS),
    }),
    tls13: Some(VersionRules {
        support: Level::Should,
        // Tab. 13.
        cipher_suites: recommended(&[
            C::TLS_AES_128_GCM_SHA256,
            C::TLS_AES_256_GCM_SHA384,
            C::TLS_AES_128_CCM_SHA256,
        ]),
        // Tab. 10.
        groups: recommended(&[
            G::SECP256R1,
            G::SECP384R1,
            G::SECP521R1,
            G::BRAINPOOLP256R1_TLS13,
            G::BRAINPOOLP384R1_TLS13,
            G::BRAINPOOLP512R1_TLS13,
            G::FFDHE3072,
            G::FFDHE4096,
        ]),
        signature_schemes: recommended(TR02102_TLS13_SIGS),
        cert_signature_schemes: recommended(TR02102_TLS13_SIGS),
    }),
    // Certificate content beyond keys and signatures is TR-02103's, not encoded here.
    cert: CertRules {
        // Tab. 14: ECDSA at least 250 bits (every listed curve), RSA at least 3000 bits.
        keys: recommended(&[
            KeyRule::Ec(Curve::P256),
            KeyRule::Ec(Curve::P384),
            KeyRule::Ec(Curve::P521),
            KeyRule::Ec(Curve::BrainpoolP256r1),
            KeyRule::Ec(Curve::BrainpoolP384r1),
            KeyRule::Ec(Curve::BrainpoolP512r1),
            KeyRule::RsaMin(3000),
        ]),
        // Tab. 12 without rsa_pkcs1_* (recommended only up to 2025).
        signatures: recommended(&[
            Sig::EcdsaSha256,
            Sig::EcdsaSha384,
            Sig::EcdsaSha512,
            Sig::RsaPssSha256,
            Sig::RsaPssSha384,
            Sig::RsaPssSha512,
        ]),
        ..CertRules::ANY
    },
    // §3.5: depends on the application; "usually required" in closed systems.
    mutual_auth: false,
    revocation: Revocation::Unspecified,
    max_session_lifetime: None,
    // Notes to Tab. 3: CBC suites are recommended only with Encrypt-then-MAC.
    encrypt_then_mac: Level::Must,
    extended_master_secret: Level::Should,
    // §3.3.4.1: only per RFC 5746, and the server should refuse client-initiated renegotiation.
    renegotiation: Level::May,
    // §3.4.1: sending or accepting 0-RTT data is not recommended.
    early_data: Level::ShouldNot,
    sni: Level::May,
    notes: &[
        "Tab. 2: TLS 1.2 is recommended only until the end of 2031; prefer TLS 1.3",
        "Tab. 3, 6: TLS_DHE_* suites and ffdhe groups in TLS 1.2 only until 2029",
        "Tab. 10: classical (EC)DHE alone only until 2031; hybrid ML-KEM groups will follow once RFCs",
        "left out: entries recommended only up to 2025 or 2026 (rsa_pkcs1, static DH, RSA_PSK, psk_ke)",
        "left out: DSA and TLS_DHE_DSS (to 2029, not approved in FIPS 186-5); PSK suites (Tab. 5)",
        "§3.3.4: no truncated HMAC, no Heartbeat, no compression; renegotiation only per RFC 5746",
        "§3.5, §3.6: certificates per TR-02103; key lengths per TR-02102-1",
    ],
};

/// Every profile this crate ships.
pub const ALL: &[Profile] = &[BDEW_AS4, BSI_TR_03116_3, BSI_TR_02102_2];

/// The profile with this [`Profile::id`].
pub fn by_id(id: &str) -> Option<&'static Profile> {
    ALL.iter().find(|p| p.id == id)
}