---
cases:
  - note: cryptoX509ParseKeyPairs/PEM_encoded_string_cert_and_key
    query: data.test.p = x
    modules:
      - |
        package test

        p := crypto.x509.parse_keypair(input.cert, input.key).Certificate[0]
    input:
      cert: |
        -----BEGIN CERTIFICATE-----
        MIIEszCCApsCFDPRm4sTNZqiH601E6E6pEaJaCKqMA0GCSqGSIb3DQEBCwUAMBYx
        FDASBgNVBAMMC2V4YW1wbGUuY29tMB4XDTIzMDUxMjEyMDIxNFoXDTIzMDYxMTEy
        MDIxNFowFjEUMBIGA1UEAwwLZXhhbXBsZS5jb20wggIiMA0GCSqGSIb3DQEBAQUA
        A4ICDwAwggIKAoICAQDTcNASD17ohP3V14LMUIkFwAeeeniSXy4Pl3EqIgVpt9ul
        2IZiTm4JOYSgQ681bjt1OdwCkBf2Cg62DUyHMMwwnbaznN/Y5piYlaS33XCvcNpM
        OWxwA4Z5Q0jNAshBExp8EzjEojbIUoeSncAP9jtOO/NArhLq+XodmONLqBG8KmZc
        2uiAeJ7ZjTpOckASYPYy7tUc4Ha3XUV0SoF/+0SJrXYOtpyMuMxwks6jMbpacmZn
        jFIe8m2xH97s5inmHkzjBVKbpBQQHROP6A61VOrH9FrJRiACZ440zFJ1CGlXZau4
        oJgs9S1YRDI4W2Ha1WIYLpUBEMYXVYyn4swTBj42HqpSmfppOoR2g1d/AjxpFVAk
        PLrict/nszhTIkEUE39vJh4HuytT49ss/cp4KokxBjLz7LmTUEzxJS8dB9714KzO
        hFRHnpap0onU7Yb+Yz8/21bZL4AEL1d2Jg48jRET1Mrl9GOnWjzo7JxioUsbLcOo
        y8Qcu2L87BQZqHCVpq6TcJKfPgh9t7y1AHvAfoXJdGSwimCZXuR4VEA3NJAHgPOw
        LypB+dukzseWLdN+e7YOYqyWfjJg4aQmCx+nr866/QlQ4mrEBTkBsDOO5tEsKugI
        redu+lL6z9QFdmeQpoC+s6JKnV29KHZXNDBZ1gnXOyA6lIBjjFjZqnkwT1ToHwID
        AQABMA0GCSqGSIb3DQEBCwUAA4ICAQC8v5BIEooDSe5Kpzwsh9QLK7Ip33v4VHo+
        q82DRjAXiosFoaJ1dg+hwXOUo5VPSOqWCPNYRHDabuX4oiZAGPA9O5lTKQ/PQS4y
        YIsD9XgeuDllBo3Y/uBwjoFFAD169fYMmZgGQ/PCdFS9nrYduPAIzNnsip+Z+XRK
        qLwm83H/nKKgVvbGprNcivG3c8H42CKQ7aqDkEGuSG9EVRnQOMaI7ILMx/oj33Mk
        uJ/21z4AHj7ads3dUF4syEBo5gWCAiBd+g1E/BkFnn+G+oOYo7c12dB+r6rbgrA0
        Bk+bW0NvU2ApP/LRRGaJD4wW2UoAklL618+CRWNtXdT+WeKIPlrEdC/0yzU5t6sA
        II+PfvbeWQfL5CssbWhkTbJFt3JKTrIMc9cMjNcqeS+bAELuI16d4CZ5TlmZZeMd
        1WCv6R3YifkR9IogZhix20nPCF1mfo7Q0XAywkx8pPAC4n6uYStU9YobNAGlWXz+
        YbbJDf9r9au88Gu6xFf3eETKu2tJsQgVYBmXic85+FoV45qBI5YZvqiX9XZtWXw2
        391fW+NdK01Jc0tqtADubaF6D4ncnriufqcz+70O0p7CzPbTMtUsPFxcfqZ6x1KX
        gP1TgZM++PuYjHEyCFhHQBz9cQlxPdW4alaDYBnnKvLZXDOAXCWVWS6SXa5tkU3n
        k9i0HC1bhg==
        -----END CERTIFICATE-----
      key: |
        -----BEGIN PRIVATE KEY-----
        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
        Aj0c+XArCS87P4iflF9maJ3Tk/NfaA==
        -----END PRIVATE KEY-----
    want_result:
      - x: MIIEszCCApsCFDPRm4sTNZqiH601E6E6pEaJaCKqMA0GCSqGSIb3DQEBCwUAMBYxFDASBgNVBAMMC2V4YW1wbGUuY29tMB4XDTIzMDUxMjEyMDIxNFoXDTIzMDYxMTEyMDIxNFowFjEUMBIGA1UEAwwLZXhhbXBsZS5jb20wggIiMA0GCSqGSIb3DQEBAQUAA4ICDwAwggIKAoICAQDTcNASD17ohP3V14LMUIkFwAeeeniSXy4Pl3EqIgVpt9ul2IZiTm4JOYSgQ681bjt1OdwCkBf2Cg62DUyH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