Class: Sigstore::TUF::Targets::Target

Inherits:
Object
  • Object
show all
Includes:
BaseFile
Defined in:
lib/sigstore/tuf/targets.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from BaseFile

included

Constructor Details

#initialize(data, path) ⇒ Target



53
54
55
56
57
# File 'lib/sigstore/tuf/targets.rb', line 53

def initialize(data, path)
  @path = path
  @length = data.fetch("length")
  @hashes = data.fetch("hashes")
end

Instance Attribute Details

#hashesObject (readonly)

Returns the value of attribute hashes.



49
50
51
# File 'lib/sigstore/tuf/targets.rb', line 49

def hashes
  @hashes
end

#pathObject (readonly)

Returns the value of attribute path.



49
50
51
# File 'lib/sigstore/tuf/targets.rb', line 49

def path
  @path
end

Instance Method Details

#verify_length_and_hashes(data) ⇒ Object



59
60
61
62
# File 'lib/sigstore/tuf/targets.rb', line 59

def verify_length_and_hashes(data)
  self.class.verify_length(data, @length)
  self.class.verify_hashes(data, @hashes)
end