Skip to content
This repository was archived by the owner on Aug 27, 2022. It is now read-only.
This repository was archived by the owner on Aug 27, 2022. It is now read-only.

Expand supported hash types #21

Description

@stevespringett

Hash support is limited and ambiguous in the case of SHA. CycloneDX is more precise and supports the following:

<xs:simpleType name="hashAlg">
  <xs:restriction base="xs:string">
    <xs:enumeration value="MD5"/>
    <xs:enumeration value="SHA-1"/>
    <xs:enumeration value="SHA-256"/>
    <xs:enumeration value="SHA-384"/>
    <xs:enumeration value="SHA-512"/>
    <xs:enumeration value="SHA3-256"/>
    <xs:enumeration value="SHA3-512"/>
  </xs:restriction>
</xs:simpleType>

<xs:simpleType name="hashValue">
  <xs:restriction base="xs:token">
    <xs:pattern value="([a-fA-F0-9]{32})|([a-fA-F0-9]{40})|([a-fA-F0-9]{64})|([a-fA-F0-9]{96})|([a-fA-F0-9]{128})"/>
  </xs:restriction>
</xs:simpleType>

It also supports simple validation of the field as well, although complex validation (e.g. SHA-512 alg with only 40 characters) is not supported.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions