---
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-----\nMIIEszCCApsCFDPRm4sTNZqiH601E6E6pEaJaCKqMA0GCSqGSIb3DQEBCwUAMBYx\nFDASBgNVBAMMC2V4YW1wbGUuY29tMB4XDTIzMDUxMjEyMDIxNFoXDTIzMDYxMTEy\nMDIxNFowFjEUMBIGA1UEAwwLZXhhbXBsZS5jb20wggIiMA0GCSqGSIb3DQEBAQUA\nA4ICDwAwggIKAoICAQDTcNASD17ohP3V14LMUIkFwAeeeniSXy4Pl3EqIgVpt9ul\n2IZiTm4JOYSgQ681bjt1OdwCkBf2Cg62DUyHMMwwnbaznN/Y5piYlaS33XCvcNpM\nOWxwA4Z5Q0jNAshBExp8EzjEojbIUoeSncAP9jtOO/NArhLq+XodmONLqBG8KmZc\n2uiAeJ7ZjTpOckASYPYy7tUc4Ha3XUV0SoF/+0SJrXYOtpyMuMxwks6jMbpacmZn\njFIe8m2xH97s5inmHkzjBVKbpBQQHROP6A61VOrH9FrJRiACZ440zFJ1CGlXZau4\noJgs9S1YRDI4W2Ha1WIYLpUBEMYXVYyn4swTBj42HqpSmfppOoR2g1d/AjxpFVAk\nPLrict/nszhTIkEUE39vJh4HuytT49ss/cp4KokxBjLz7LmTUEzxJS8dB9714KzO\nhFRHnpap0onU7Yb+Yz8/21bZL4AEL1d2Jg48jRET1Mrl9GOnWjzo7JxioUsbLcOo\ny8Qcu2L87BQZqHCVpq6TcJKfPgh9t7y1AHvAfoXJdGSwimCZXuR4VEA3NJAHgPOw\nLypB+dukzseWLdN+e7YOYqyWfjJg4aQmCx+nr866/QlQ4mrEBTkBsDOO5tEsKugI\nredu+lL6z9QFdmeQpoC+s6JKnV29KHZXNDBZ1gnXOyA6lIBjjFjZqnkwT1ToHwID\nAQABMA0GCSqGSIb3DQEB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