Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 41 additions & 4 deletions schema/2.0/model/cyclonedx-cryptography-2.0.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@
]
},
"fingerprint": {
"$ref": "cyclonedx-common-2.0.schema.json#/$defs/hash",
"$ref": "#/$defs/fingerprint",
"title": "Certificate Fingerprint",
"description": "The fingerprint is a cryptographic hash of the certificate excluding it's signature."
},
Expand Down Expand Up @@ -718,9 +718,7 @@
"description": "The mechanism by which the cryptographic asset is secured by."
},
"fingerprint": {
"$ref": "cyclonedx-common-2.0.schema.json#/$defs/hash",
"title": "Fingerprint",
"description": "The fingerprint is a cryptographic hash of the asset."
"$ref": "#/$defs/fingerprint"
},
"relatedCryptographicAssets": {
"$ref": "#/$defs/relatedCryptographicAssets"
Expand Down Expand Up @@ -1119,6 +1117,45 @@
}
}
},
"fingerprint": {
"type": "object",
"title": "Fingerprint",
"description": "The fingerprint is a cryptographic hash of the asset.",
"oneOf": [
{
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@stevespringett

this data structure looks pretty much like cyclonedx-common-2.0.schema.json#$defs/hash.

To prevent any confusion, we should add narrow titles/descriptions to cyclonedx-common-2.0.schema.json#$defs/hash/properties/alg and cyclonedx-common-2.0.schema.json#$defs/hash/properties/content

something like

{
// cyclonedx-common-2.0.schema.json#$defs
    "hash": {
      "type": "object",
      "title": "Hash",
      "required": [
        "alg",
        "content"
      ],
      "additionalProperties": false,
      "properties": {
        "alg": {
          "$ref": "#/$defs/hashAlgorithm",
          "titile": "Hash algorithm",
          "description": "Standard, well-known algorithm used to compute the hash"
        },
        "content": {
          "$ref": "#/$defs/hashValue",
          "titile": "Hash value",
          "description": "The value of the hash computed using the standard, well-known algorithm"
        }
      }
    },
}

"title": "Standard Hash",
"description": "A fingerprint computed using a standard, well-known hash algorithm.",
"required": ["alg", "content"],
"additionalProperties": false,
"properties": {
"alg": {
"$ref": "cyclonedx-common-2.0.schema.json#/$defs/hashAlgorithm"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a title and description

Suggested change
"$ref": "cyclonedx-common-2.0.schema.json#/$defs/hashAlgorithm"
"$ref": "cyclonedx-common-2.0.schema.json#/$defs/hashAlgorithm",
"title": "Standard, well-known Fingerprint Algorithm",
"description": "The standard, well-known algorithm used to compute the fingerprint."

},
"content": {
"$ref": "cyclonedx-common-2.0.schema.json#/$defs/hashValue"
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please add a title and description

Suggested change
"$ref": "cyclonedx-common-2.0.schema.json#/$defs/hashValue"
"$ref": "cyclonedx-common-2.0.schema.json#/$defs/hashValue",
"title": "Standard, well-known Fingerprint Content",
"description": "The value of the fingerprint computed using the standard, well-known algorithm."

}
}
},
{
"title": "Custom Fingerprint",
"description": "A fingerprint computed with a custom or non-standard algorithm not covered by the standard hash algorithms.",
"required": ["customAlg", "customContent"],
"additionalProperties": false,
"properties": {
"customAlg": {
"type": "string",
"title": "Custom Fingerprint Algorithm",
"description": "The name of the custom algorithm used to compute the fingerprint."
},
"customContent": {
"type": "string",
"title": "Custom Fingerprint Content",
"description": "The value of the fingerprint computed using the custom algorithm."
}
}
}
]
},
"securedBy": {
"type": "object",
"title": "Secured By",
Expand Down