Class Hash

java.lang.Object
dev.metaschema.oscal.lib.model.Hash
All Implemented Interfaces:
dev.metaschema.core.model.IBoundObject

@MetaschemaField(formalName="Hash", description="A representation of a cryptographic digest generated over a resource using a specified hash algorithm.", name="hash", moduleClass=OscalMetadataModule.class, valueConstraints=@Matches(id="oscal-check-hash-length-SHA2-3-224",level=ERROR,target=".[@algorithm=(\'SHA-224\',\'SHA3-224\')]",pattern="^[0-9a-fA-F]{56}$") @Matches(id="oscal-check-hash-length-SHA2-3-256",level=ERROR,target=".[@algorithm=(\'SHA-256\',\'SHA3-256\')]",pattern="^[0-9a-fA-F]{64}$") @Matches(id="oscal-check-hash-length-SHA2-3-384",level=ERROR,target=".[@algorithm=(\'SHA-384\',\'SHA3-384\')]",pattern="^[0-9a-fA-F]{96}$") @Matches(id="oscal-check-hash-length-SHA2-3-512",level=ERROR,target=".[@algorithm=(\'SHA-512\',\'SHA3-512\')]",pattern="^[0-9a-fA-F]{128}$")) public class Hash extends Object implements dev.metaschema.core.model.IBoundObject
A representation of a cryptographic digest generated over a resource using a specified hash algorithm.
  • Constructor Details

    • Hash

      public Hash()
      Constructs a new dev.metaschema.oscal.lib.model.Hash instance with no metadata.
    • Hash

      public Hash(dev.metaschema.core.model.IMetaschemaData data)
      Constructs a new dev.metaschema.oscal.lib.model.Hash instance with the specified metadata.
      Parameters:
      data - the metaschema data, or null if none
  • Method Details

    • getMetaschemaData

      public dev.metaschema.core.model.IMetaschemaData getMetaschemaData()
      Specified by:
      getMetaschemaData in interface dev.metaschema.core.model.IBoundObject
    • getAlgorithm

      @NonNull public String getAlgorithm()
      Get the "Hash algorithm".

      The digest method by which a hash is derived.

      Returns:
      the algorithm value
    • setAlgorithm

      public void setAlgorithm(@NonNull String value)
      Set the "Hash algorithm".

      The digest method by which a hash is derived.

      Parameters:
      value - the algorithm value to set
    • getValue

      @Nullable public String getValue()
      Get the field value.
      Returns:
      the value
    • setValue

      public void setValue(@Nullable String value)
      Set the field value.
      Parameters:
      value - the value to set
    • toString

      public String toString()
      Overrides:
      toString in class Object