Subject: [jose] First run with JSON EnvelopedSignatures

From: Anders Rundgren <[email-masked]>
Date: Wed, 21 Aug 2013 23:13:33 +0200

It turned out to be trivial.  600 lines in total for creating canonicalized + pretty-printed JSON.
That is, IF the JSON creater/parser is prepared for this task from the beginning...

So it seems that maybe 2K lines will replace 200K lines of Apache XML stuff!

  {
    "MyJSONMessage":
      {
        "VERSION": "http://example.com",
        "HRT":
          {
            "RTl": "67",
            "YT":
              {
                "HTL": "656756#",
                "INTEGER": -689
              },
            "er": "33"
          },
        "ARR": [],
        "BARR":
          [{
             "HTL": "656756#",
             "INTEGER": -689
           }],
        "STRINGS": ["One","Two","Three"],
        "Intra": 78,
        "Instant": "TGcb50pZZcUBbvl8SZUv",
        "EnvelopedSignature":
          {
            "SignatureInfo":
              {
                "Algorithm": "http://www.w3.org/2000/09/xmldsig#rsa-sha1",
                "Reference":
                  {
                    "Element": "Instant",
                    "Value": "TGcb50pZZcUBbvl8SZUv"
                  },
                "KeyInfo":
                  {
                    "SignatureCertificate":
                      {
                        "Issuer": "CN=Demo Sub CA,DC=webpki,DC=org",
                        "SerialNumber": 1159906465500,
                        "Subject": "CN=example.com,O=Example Organization"
                      },
                    "X509CertificatePath":
                      [
                       
"MIIDizCCAnOgAwIBAgIGAQ4P0BbcMA0GCSqGSIb3DQEBBQUAMEMxEzARBgoJkiaJk/IsZAEZEwNvcmcxFjAUBgoJkiaJk/IsZAEZEwZ3ZWJwa2kxFDASBgNVBAMTC0RlbW8gU3ViIENBMB4XDTA1MDMxMDEwMDAwMFoXDTEwMDMxMDA5NTk1OVowNTEdMBsGA1UEChMURXhhbXBsZSBPcmdhbml6YXRpb24xFDASBgNVBAMTC2V4YW1wbGUuY29tMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCZy7fusY+IQXGM4IqtKcQwyVbD9KQIALPMy61VkxXEZRb7lHBO9ryu+OooyCsLmDfYOO6dv7PK7jo8f4eHyBnA8qR/D4jqFfct/y8Kn77BqYNroOXukLjRJ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MDAwWhcNMjAwNzEwMDk1OTU5WjBEMRMwEQYKCZImiZPyLGQBGRMDb3JnMRYwFAYKCZImiZPyLGQBGRMGd2VicGtpMRUwEwYDVQQDEwxEZW1vIFJvb3QgQ0EwggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQCB9OnUr3WJOk4wmtUPc6pkx65XFTKQPjQFXCjj8nyFzayIYEBo7ixJYuAKtSsWc1DCEaFWXDetBe+50ayPeeF6vQx13at5h+WVyDVrDayhbNxvUiDn++dVpf9fcuIr4RWVa9D6/RzBxN2PV0EuGyGl9gdD4LHQnLYeqeGGnIkDtBVpPrFWkzRjvsGKASLFT8zoSWV1nDNFn8Hbl6WvuxIR4mwHsmMsx0LuBBEYUA9qykaE0eHG7X+U2hCGAyre85tiNE/G+tElgcVvhZLryCwri4YJE/xMB7XsdIENyfWyM7kAjrABlEtJm/nU8Ya9RfSltRPvT+L5w8oRWokyW9TdAgMBAAGjYzBhMA8GA1UdEwEB/wQFMAMBAf8wDgYDVR0PAQH/BAQDAgEGMB0GA1UdDgQWBBReit2W6pORx7pv9QsWqRpONIfEtzAfBgNVHSMEGDAWgBReit2W6pORx7pv9QsWqRpONIfEtzANBgkqhkiG9w0BAQUFAAOCAQEATPi7fR4d/lQiQ3WKAC1tBBuv8BBc26HEpRkxuCyyz/rZ7iIyxJ7L1BNkNPqPjGNBLUmd2e+K8ULjBpfmNzuWCpDqqkENx6XYpUDbPfiin1DEyVDAV2LA6ghuVQ2pAVALrIyKiUyvVpNsWedmma+eTWUEkqdIKSNiDNNcLA2dl472zd+pGrQ1KAYWG4fY/LviKEFFH4qtlaiMdQnV34hBay1aRozRWX9wig6Zwj8PQ9trJtvfWQZ4leVeTWCNttNYWFqmrZpXiOTUJdE6rO7O7lgzs+7F2xfews9ApOFNuVo33rVnQvE6kJxvdiPNIlcGnauOs8rI3fkaO8PtUgHnUw"
                      ]
                  }
              },
            "SignatureValue": "JgoGY6Od+gbxpCAK7EGT/fcnRqE42dJXePcEugqwS+ifPeGPOtZj6FkqD06JQhAchmjQiya0gNm3gC6HIpNgo6MtLQ/BL1u5I4iysidQiQx4AWzAx4hn3rbPWaxjBOWyk6JJGqNm0G736LQRbX4vWhYgeSj+JCLpu3pnt6+9tVk"
          }
      }
  }

</Anders>