import Foundation

/// Embedded test fixture: a real PKCS#12 generated at authoring time with
/// OpenSSL (EC P-256 self-signed device-CA → EC P-256 leaf, `EKU=clientAuth`,
/// exported `-legacy` for iOS/Android import parity — mirrors
/// `deploy/scripts/gen-device-ca.sh` / `issue-device-cert.sh`).
///
/// Embedded as base64 rather than an SPM resource so the MUST-PASS package test
/// runs headless with no `Bundle.module` resource wiring. Regenerate with:
///   openssl ecparam -name prime256v1 -genkey -noout -out ca.key.pem
///   openssl req -x509 -new -key ca.key.pem -sha256 -days 3650 \
///     -subj "/CN=webterm-device-ca-fixture" \
///     -addext "basicConstraints=critical,CA:TRUE" \
///     -addext "keyUsage=critical,keyCertSign,cRLSign" -out ca.cert.pem
///   openssl ecparam -name prime256v1 -genkey -noout -out leaf.key.pem
///   openssl req -new -key leaf.key.pem -subj "/CN=device-fixture" -out leaf.csr.pem
///   openssl x509 -req -in leaf.csr.pem -CA ca.cert.pem -CAkey ca.key.pem \
///     -CAcreateserial -days 825 -sha256 -extfile leaf.ext -out leaf.cert.pem
///   openssl pkcs12 -export -legacy -inkey leaf.key.pem -in leaf.cert.pem \
///     -certfile ca.cert.pem -passout pass:clienttls-test-pass \
///     -name device-fixture -out device.p12 ; base64 device.p12
enum ClientTLSFixtures {
    static let passphrase = "clienttls-test-pass"
    static let leafCommonName = "device-fixture"
    static let issuerCommonName = "webterm-device-ca-fixture"

    static var deviceP12Data: Data {
        Data(base64Encoded: deviceP12Base64)!
    }

    // swiftlint:disable:next line_length
    static let deviceP12Base64 = "MIIF8wIBAzCCBbkGCSqGSIb3DQEHAaCCBaoEggWmMIIFojCCBGcGCSqGSIb3DQEHBqCCBFgwggRUAgEAMIIETQYJKoZIhvcNAQcBMBwGCiqGSIb3DQEMAQYwDgQIKBUqQZQxk0wCAggAgIIEIBIkpttDOWO6edQjmr9V3ASfsuc0m+Wdl8//Yrt5FPgz5HOhYZKhOUXhBLWyGXPnTx8fBrC1Yk4YmXwQisHT/4PsfvwIAgF9PBFo3UNwsQ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