package wang.yaojia.webterm.clienttls

import java.util.Base64

/**
 * Real, deterministic PKCS#12 fixtures generated once with `keytool` (JDK 23), embedded base64 so
 * the pure tests need no external tooling / files. Regeneration recipe is in the A10 log entry.
 *
 * - [LEAF_P12]: keystore with a `device` PrivateKeyEntry (CN=`t1-android`, RSA, chain
 *   `device → ca`) AND a `ca` trustedCertEntry — exercises key-alias selection over a mixed store.
 *   Issuer CN = `webterm-device-ca`, notAfter far in the future.
 * - [TRUST_P12]: keystore with only the `ca` trustedCertEntry (no key) — the noIdentity case.
 *
 * Passphrase for both is [PASSPHRASE].
 */
internal object Fixtures {
    const val PASSPHRASE: String = "test-pass"
    const val WRONG_PASSPHRASE: String = "wrong-pass"

    const val LEAF_SUBJECT_CN: String = "t1-android"
    const val LEAF_ISSUER_CN: String = "webterm-device-ca"

    fun leafP12(): ByteArray = Base64.getDecoder().decode(LEAF_P12)
    fun trustP12(): ByteArray = Base64.getDecoder().decode(TRUST_P12)

    private const val LEAF_P12: String =
        "[encoded data, 5752 characters]"

    private const val TRUST_P12: String =
        "MIIEYgIBAzCCBAwGCSqGSIb3DQEHAaCCA/0EggP5MIID9TCCA/EGCSqGSIb3DQEHBqCCA+IwggPeAgEAMIID1wYJKoZIhvcNAQcBMGYGCSqGSIb3DQEFDTBZMDgGCSqGSIb3DQEFDDArBBSrewHUfPbr+otdl4tmwoDvEJINhgICJxACASAwDAYIKoZIhvcNAgkFADAdBglghkgBZQMEASoEENk23MvOQSnK5Pgy9odZiGGAggNg8I3/LcDIrF3uMG9grSSd1zKNVz+MVstaDZiREnwFHI0rUiKwiMUDpjGGSAUVglBCWglNOqWwbmNF8HiWgLcvJhH39mCzGI9n2nos3NceWVDVSh739ZdvY1wQS0jYyuyjfj3ECTuAIytkIMFn75Ar2gUURKjRRxgiZAPXUAm6WohBKYyHuqpSAcPSByvIOoP2IeBNl9GVCnVDGCQ4Q/9a+CjF0tN0lV/ajkn1jFJHbJPDojB5Wp3dyO5elqUEHk+d3zyb0uYG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