Commit 07d46fb7 authored by Mark Canterbury's avatar Mark Canterbury
Browse files

Merge branch 'cr/103120/133' into 'meeting/LI73'

TS 103 120 CR 133 - Other approach of digital signatures

See merge request !327
parents 15b9f4a9 6b73bc9a
Loading
Loading
Loading
Loading
Loading
+52 −0
Original line number Diff line number Diff line
{
  "@xmlns": "http://uri.etsi.org/03120/common/2019/10/Core",
  "@xmlns:xsi": "http://www.w3.org/2001/XMLSchema-instance",
  "@xmlns:common": "http://uri.etsi.org/03120/common/2016/02/Common",
  "@xmlns:task": "http://uri.etsi.org/03120/common/2020/09/Task",
  "@xmlns:auth": "http://uri.etsi.org/03120/common/2020/09/Authorisation",
  "Header": {
    "SenderIdentifier": {
      "CountryCode": "XX",
      "UniqueIdentifier": "ACTOR01"
    },
    "ReceiverIdentifier": {
      "CountryCode": "XX",
      "UniqueIdentifier": "ACTOR02"
    },
    "TransactionIdentifier": "c02358b2-76cf-4ba4-a8eb-f6436ccaea2e",
    "Timestamp": "2015-09-01T12:00:01.000000Z",
    "Version": {
      "ETSIVersion": "V1.13.1",
      "NationalProfileOwner": "XX",
      "NationalProfileVersion": "v1.0"
    }
  },
  "Payload": {
    "ResponsePayload": {
      "ActionResponses": {
        "ActionResponse": [
          {
            "ActionIdentifier": 0,
            "CREATEResponse": {
              "Identifier": "7dbbc880-8750-4d3c-abe7-ea4a17646045"
            }
          },
          {
            "ActionIdentifier": 1,
            "CREATEResponse": {
              "Identifier": "2b36a78b-b628-416d-bd22-404e68a0cd36"
            }
          }
        ]
      }
    }
  },
  "Signatures": [
    {
      "hash_algorithm": "sha-256",
      "algorithm": "Ed25519",
      "public_key": "MCowBQYDK2VwAyEAubMonBfU9pvIbj5RCiWQLD45Jvu6mKr+kQXjvjW8ZkU",
      "value": "B6vWORSsHlPfyHOvqEhnyH0vEVI90gfZADeP7uLQPOrYfDKMIZKopcnag9hZH0IrAZhgz5awTgt6AUfRX/fCCA=="
    }
  ]
}
+26 −0
Original line number Diff line number Diff line
@@ -27,6 +27,32 @@
            "protected",
            "signature"
          ]
        },
        "Signatures": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "object",
            "properties": {
              "hash_algorithm": {
                "type": "string"
              },
              "algorithm": {
                "type": "string"
              },
              "public_key": {
                "type": "string"
              },
              "value": {
                "type": "string"
              }
            },
            "required": [
              "hash_algorithm",
              "algorithm",
              "value"
            ]
          }
        }
      },
      "required": [
+2 −0
Original line number Diff line number Diff line
@@ -13,6 +13,8 @@
            <xs:element name="Signature" minOccurs="0"/>
            <!-- Use of the Signature element is discouraged – implementers are encouraged use the digsig:Signature element below instead -->
            <xs:element ref="digsig:Signature" minOccurs="0"/>
            <!-- The Signatures element is introduced for JSS support, and is not intended for use in XML-format instance documents.-->
            <xs:element name="Signatures" minOccurs="0"/>
        </xs:sequence>
    </xs:complexType>
    <xs:complexType name="MessageHeader">
+9 −1
Original line number Diff line number Diff line
@@ -12,7 +12,13 @@ logging.basicConfig(level=logging.INFO)

json_signature_struct = {
    "properties": {"protected": {"type": "string"}, "signature": {"type": "string"}},
    "required": ["protected", "signature"],
    "required": ["protected", "signature"]
}

json_x590_signature_struct = {
    "type": "array", "minItems": 1, "items": {"type": "object",
    "properties": {"hash_algorithm": {"type": "string"}, "algorithm": {"type": "string"}, "public_key": {"type": "string"}, "value": {"type": "string"}  }
    "required": ["hash_algorithm", "algorithm", "value"] }
}


@@ -89,6 +95,8 @@ if __name__ == "__main__":
            js["$defs"]["HI1Message"]["patternProperties"] = {"^@": {"type": "string"}}
            js["$defs"]["HI1Message"]["properties"].pop("xmldsig:Signature")
            js["$defs"]["HI1Message"]["properties"]["Signature"] = json_signature_struct
            js["$defs"]["HI1Message"]["properties"]["Signatures"] = json_x590_signature_struct


        if "output" in ns_map[schema_tuple[0]]:
            js_path = Path(ns_map[schema_tuple[0]]["output"]) / convert_xsd_to_filename(