Class: Sigstore::Rekor::Checkpoint::LogCheckpoint
- Inherits:
-
Struct
- Object
- Struct
- Sigstore::Rekor::Checkpoint::LogCheckpoint
- Defined in:
- lib/sigstore/rekor/checkpoint.rb
Instance Attribute Summary collapse
-
#log_hash ⇒ Object
Returns the value of attribute log_hash.
-
#log_size ⇒ Object
Returns the value of attribute log_size.
-
#origin ⇒ Object
Returns the value of attribute origin.
-
#other_content ⇒ Object
Returns the value of attribute other_content.
Class Method Summary collapse
Instance Attribute Details
#log_hash ⇒ Object
Returns the value of attribute log_hash
80 81 82 |
# File 'lib/sigstore/rekor/checkpoint.rb', line 80 def log_hash @log_hash end |
#log_size ⇒ Object
Returns the value of attribute log_size
80 81 82 |
# File 'lib/sigstore/rekor/checkpoint.rb', line 80 def log_size @log_size end |
#origin ⇒ Object
Returns the value of attribute origin
80 81 82 |
# File 'lib/sigstore/rekor/checkpoint.rb', line 80 def origin @origin end |
#other_content ⇒ Object
Returns the value of attribute other_content
80 81 82 |
# File 'lib/sigstore/rekor/checkpoint.rb', line 80 def other_content @other_content end |
Class Method Details
.from_text(text) ⇒ Object
83 84 85 86 87 88 89 90 91 92 93 94 95 |
# File 'lib/sigstore/rekor/checkpoint.rb', line 83 def self.from_text(text) lines = text.strip.split("\n") raise Error::InvalidCheckpoint, "too few items in header" if lines.size < 3 origin = lines.shift log_size = lines.shift.to_i root_hash = lines.shift.unpack1("m0") raise Error::InvalidCheckpoint, "empty origin" if origin.empty? new(origin:, log_size:, log_hash: root_hash, other_content: lines) end |