From 6f38f48cd88359f16c6d17be775049ac4436aecc Mon Sep 17 00:00:00 2001
From: Basil Hess <bhe@zurich.ibm.com>
Date: Wed, 11 Oct 2023 19:36:46 +0200
Subject: [PATCH 1/2] CBOM: merges relatedCryptoMaterial and key asset types

Signed-off-by: Basil Hess <bhe@zurich.ibm.com>
---
 schema/bom-1.6.schema.json | 206 ++++++++++++++++---------------------
 1 file changed, 90 insertions(+), 116 deletions(-)

diff --git a/schema/bom-1.6.schema.json b/schema/bom-1.6.schema.json
index d9f6dfd0a..789a92b77 100644
--- a/schema/bom-1.6.schema.json
+++ b/schema/bom-1.6.schema.json
@@ -3828,7 +3828,6 @@
           "enum": [
             "algorithm",
             "certificate",
-            "key",
             "protocol",
             "relatedCryptoMaterial"
           ]
@@ -4228,127 +4227,102 @@
             }
           }
         },
-        "keyProperties": {
-          "type": "object",
-          "title": "Properties for Keys",
-          "description": "Properties for crypto assets of asset type 'key'",
-          "additionalProperties": false,
-          "properties": {
-            "type": {
-              "type": "string",
-              "title": "key type",
-              "description": "The type of the key",
-              "enum": [
-                "privateKey",
-                "publicKey",
-                "secretKey"
-              ]
-            },
-            "id": {
-              "type": "string",
-              "title": "key id",
-              "description": "The identifier for the key"
-            },
-            "state": {
-              "type": "string",
-              "title": "key state",
-              "description": "The key state according to NIST SP 800-57",
-              "enum": [
-                "preActivation",
-                "active",
-                "suspended",
-                "deactivated",
-                "compromised",
-                "destroyed"
-              ]
-            },
-            "size": {
-              "type": "integer",
-              "title": "Crypto asset size (in bits)",
-              "description": "Size of the crypto asset (in bits)"
-            },
-            "keyAlgorithmRef": {
-              "$ref": "#/definitions/cryptoRef",
-              "title": "Algorithm reference",
-              "description": "Bom-ref to algorithm used to generate the key"
-            },
-            "securedBy": {
-              "$ref": "#/definitions/securedBy",
-              "title": "Crypto asset is secured by"
-            },
-            "creationDate": {
-              "type": "string",
-              "format": "date-time",
-              "title": "creation date",
-              "description": "The date and time (timestamp) when the key was created."
-            },
-            "activationDate": {
-              "type": "string",
-              "format": "date-time",
-              "title": "activation date",
-              "description": "The date and time (timestamp) when the key was activated."
-            },
-            "updateDate": {
-              "type": "string",
-              "format": "date-time",
-              "title": "update date",
-              "description": "The date and time (timestamp) when the key was updated."
-            },
-            "expirationDate": {
-              "type": "string",
-              "format": "date-time",
-              "title": "expiration date",
-              "description": "The date and time (timestamp) when the key expired."
-            }
-          }
-        },
         "relatedCryptoMaterialProperties": {
           "type": "object",
           "title": "related crypto material properties",
           "description": "Properties for crypto assets of asset type 'relatedCryptoMaterial'",
           "additionalProperties": false,
           "properties": {
-            "type": {
-              "type": "string",
-              "title": "relatedCryptoMaterialType",
-              "description": "The type for the related crypto material",
-              "enum": [
-                "ciphertext",
-                "signature",
-                "digest",
-                "initializationVector",
-                "nonce",
-                "seed",
-                "salt",
-                "sharedSecret",
-                "tag",
-                "additionalData",
-                "password",
-                "credential",
-                "token",
-                "other",
-                "unknown"
-              ]
-            },
-            "value": {
-              "type": "string",
-              "title": "Value assosiated to the crypto material",
-              "description": "The assosiated value of the crypto material"
-            },
-            "size": {
-              "type": "integer",
-              "title": "Crypto asset size (in bits)",
-              "description": "Size of the crypto asset (in bits)"
-            },
-            "format": {
-              "type": "string",
-              "title": "format",
-              "description": "format of the related crypto material (e.g. P8, PEM, DER)"
-            },
-            "securedBy": {
-              "$ref": "#/definitions/securedBy",
-              "title": "Crypto asset is secured by"
-            }
+              "type": {
+                  "type": "string",
+                  "title": "relatedCryptoMaterialType",
+                  "description": "The type for the related crypto material",
+                  "enum": [
+                      "privateKey",
+                      "publicKey",
+                      "secretKey",
+                      "ciphertext",
+                      "signature",
+                      "digest",
+                      "initializationVector",
+                      "nonce",
+                      "seed",
+                      "salt",
+                      "sharedSecret",
+                      "tag",
+                      "additionalData",
+                      "password",
+                      "credential",
+                      "token",
+                      "other",
+                      "unknown"
+                  ]
+              },
+              "id": {
+                  "type": "string",
+                  "title": "key id",
+                  "description": "The identifier for the key"
+              },
+              "state": {
+                  "type": "string",
+                  "title": "key state",
+                  "description": "The key state according to NIST SP 800-57",
+                  "enum": [
+                      "preActivation",
+                      "active",
+                      "suspended",
+                      "deactivated",
+                      "compromised",
+                      "destroyed"
+                  ]
+              },
+              "algorithmRef": {
+                  "$ref": "#/definitions/cryptoRef",
+                  "title": "Algorithm reference",
+                  "description": "Bom-ref to algorithm used to generate the relatedCryptoMaterial"
+              },
+              "creationDate": {
+                  "type": "string",
+                  "format": "date-time",
+                  "title": "creation date",
+                  "description": "The date and time (timestamp) when the relatedCryptoMaterial was created."
+              },
+              "activationDate": {
+                  "type": "string",
+                  "format": "date-time",
+                  "title": "activation date",
+                  "description": "The date and time (timestamp) when the relatedCryptoMaterial was activated."
+              },
+              "updateDate": {
+                  "type": "string",
+                  "format": "date-time",
+                  "title": "update date",
+                  "description": "The date and time (timestamp) when the relatedCryptoMaterial was updated."
+              },
+              "expirationDate": {
+                  "type": "string",
+                  "format": "date-time",
+                  "title": "expiration date",
+                  "description": "The date and time (timestamp) when the relatedCryptoMaterial expired."
+              },
+              "value": {
+                  "type": "string",
+                  "title": "Value assosiated to the crypto material",
+                  "description": "The assosiated value of the crypto material"
+              },
+              "size": {
+                  "$ref": "#/definitions/size",
+                  "title": "Crypto asset size (in bits)"
+              },
+              "format": {
+                  "type": "string",
+                  "title": "format",
+                  "description": "format of the related crypto material (e.g. P8, PEM, DER)"
+              },
+              "securedBy": {
+                  "$ref": "#/definitions/securedBy",
+                  "title": "Crypto asset is secured by"
+              }
           }
         },
         "protocolProperties": {

From e91b9f07b6f989125928cbd657c32f1d8553c3c5 Mon Sep 17 00:00:00 2001
From: Basil Hess <bhe@zurich.ibm.com>
Date: Thu, 12 Oct 2023 16:09:30 +0200
Subject: [PATCH 2/2] fix size type and formatting

Signed-off-by: Basil Hess <bhe@zurich.ibm.com>
---
 schema/bom-1.6.schema.json | 180 ++++++++++++++++++-------------------
 1 file changed, 90 insertions(+), 90 deletions(-)

diff --git a/schema/bom-1.6.schema.json b/schema/bom-1.6.schema.json
index 789a92b77..8d918819f 100644
--- a/schema/bom-1.6.schema.json
+++ b/schema/bom-1.6.schema.json
@@ -4233,96 +4233,96 @@
           "description": "Properties for crypto assets of asset type 'relatedCryptoMaterial'",
           "additionalProperties": false,
           "properties": {
-              "type": {
-                  "type": "string",
-                  "title": "relatedCryptoMaterialType",
-                  "description": "The type for the related crypto material",
-                  "enum": [
-                      "privateKey",
-                      "publicKey",
-                      "secretKey",
-                      "ciphertext",
-                      "signature",
-                      "digest",
-                      "initializationVector",
-                      "nonce",
-                      "seed",
-                      "salt",
-                      "sharedSecret",
-                      "tag",
-                      "additionalData",
-                      "password",
-                      "credential",
-                      "token",
-                      "other",
-                      "unknown"
-                  ]
-              },
-              "id": {
-                  "type": "string",
-                  "title": "key id",
-                  "description": "The identifier for the key"
-              },
-              "state": {
-                  "type": "string",
-                  "title": "key state",
-                  "description": "The key state according to NIST SP 800-57",
-                  "enum": [
-                      "preActivation",
-                      "active",
-                      "suspended",
-                      "deactivated",
-                      "compromised",
-                      "destroyed"
-                  ]
-              },
-              "algorithmRef": {
-                  "$ref": "#/definitions/cryptoRef",
-                  "title": "Algorithm reference",
-                  "description": "Bom-ref to algorithm used to generate the relatedCryptoMaterial"
-              },
-              "creationDate": {
-                  "type": "string",
-                  "format": "date-time",
-                  "title": "creation date",
-                  "description": "The date and time (timestamp) when the relatedCryptoMaterial was created."
-              },
-              "activationDate": {
-                  "type": "string",
-                  "format": "date-time",
-                  "title": "activation date",
-                  "description": "The date and time (timestamp) when the relatedCryptoMaterial was activated."
-              },
-              "updateDate": {
-                  "type": "string",
-                  "format": "date-time",
-                  "title": "update date",
-                  "description": "The date and time (timestamp) when the relatedCryptoMaterial was updated."
-              },
-              "expirationDate": {
-                  "type": "string",
-                  "format": "date-time",
-                  "title": "expiration date",
-                  "description": "The date and time (timestamp) when the relatedCryptoMaterial expired."
-              },
-              "value": {
-                  "type": "string",
-                  "title": "Value assosiated to the crypto material",
-                  "description": "The assosiated value of the crypto material"
-              },
-              "size": {
-                  "$ref": "#/definitions/size",
-                  "title": "Crypto asset size (in bits)"
-              },
-              "format": {
-                  "type": "string",
-                  "title": "format",
-                  "description": "format of the related crypto material (e.g. P8, PEM, DER)"
-              },
-              "securedBy": {
-                  "$ref": "#/definitions/securedBy",
-                  "title": "Crypto asset is secured by"
-              }
+            "type": {
+                "type": "string",
+                "title": "relatedCryptoMaterialType",
+                "description": "The type for the related crypto material",
+                "enum": [
+                    "privateKey",
+                    "publicKey",
+                    "secretKey",
+                    "ciphertext",
+                    "signature",
+                    "digest",
+                    "initializationVector",
+                    "nonce",
+                    "seed",
+                    "salt",
+                    "sharedSecret",
+                    "tag",
+                    "additionalData",
+                    "password",
+                    "credential",
+                    "token",
+                    "other",
+                    "unknown"
+                ]
+            },
+            "id": {
+                "type": "string",
+                "title": "id",
+                "description": "The identifier for the relatedCryptoMaterial"
+            },
+            "state": {
+                "type": "string",
+                "title": "state",
+                "description": "The key state according to NIST SP 800-57",
+                "enum": [
+                    "preActivation",
+                    "active",
+                    "suspended",
+                    "deactivated",
+                    "compromised",
+                    "destroyed"
+                ]
+            },
+            "algorithmRef": {
+                "$ref": "#/definitions/cryptoRef",
+                "title": "Algorithm reference",
+                "description": "Bom-ref to algorithm used to generate the relatedCryptoMaterial"
+            },
+            "creationDate": {
+                "type": "string",
+                "format": "date-time",
+                "title": "creation date",
+                "description": "The date and time (timestamp) when the relatedCryptoMaterial was created."
+            },
+            "activationDate": {
+                "type": "string",
+                "format": "date-time",
+                "title": "activation date",
+                "description": "The date and time (timestamp) when the relatedCryptoMaterial was activated."
+            },
+            "updateDate": {
+                "type": "string",
+                "format": "date-time",
+                "title": "update date",
+                "description": "The date and time (timestamp) when the relatedCryptoMaterial was updated."
+            },
+            "expirationDate": {
+                "type": "string",
+                "format": "date-time",
+                "title": "expiration date",
+                "description": "The date and time (timestamp) when the relatedCryptoMaterial expired."
+            },
+            "value": {
+                "type": "string",
+                "title": "Value assosiated to the crypto material",
+                "description": "The assosiated value of the crypto material"
+            },
+            "size": {
+                "type": "integer",
+                "title": "Crypto asset size (in bits)"
+            },
+            "format": {
+                "type": "string",
+                "title": "format",
+                "description": "format of the related crypto material (e.g. P8, PEM, DER)"
+            },
+            "securedBy": {
+                "$ref": "#/definitions/securedBy",
+                "title": "Crypto asset is secured by"
+            }
           }
         },
         "protocolProperties": {
