Package dev.metaschema.oscal.lib.model
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionGet the "Hash algorithm".dev.metaschema.core.model.IMetaschemaDatagetValue()Get the field value.voidsetAlgorithm(String value) Set the "Hash algorithm".voidSet the field value.toString()
-
Constructor Details
-
Hash
public Hash()Constructs a newdev.metaschema.oscal.lib.model.Hashinstance with no metadata. -
Hash
Constructs a newdev.metaschema.oscal.lib.model.Hashinstance with the specified metadata.- Parameters:
data- the metaschema data, ornullif none
-
-
Method Details
-
getMetaschemaData
- Specified by:
getMetaschemaDatain interfacedev.metaschema.core.model.IBoundObject
-
getAlgorithm
Get the "Hash algorithm".The digest method by which a hash is derived.
- Returns:
- the algorithm value
-
setAlgorithm
Set the "Hash algorithm".The digest method by which a hash is derived.
- Parameters:
value- the algorithm value to set
-
getValue
Get the field value.- Returns:
- the value
-
setValue
Set the field value.- Parameters:
value- the value to set
-
toString
-