Class: Rupert::RPM::Signature
- Inherits:
-
Object
- Object
- Rupert::RPM::Signature
- Defined in:
- lib/rupert/rpm/signature.rb,
lib/rupert/rpm/signature/entry.rb,
lib/rupert/rpm/signature/index.rb,
lib/rupert/rpm/signature/store.rb
Defined Under Namespace
Constant Summary collapse
- MD5_TAG =
Tag holding 128-bit MD5 checksum of header and payload
1004.freeze
Instance Method Summary collapse
-
#initialize(index) ⇒ Signature
constructor
Creates a new signature given its components.
-
#md5 ⇒ String
MD5 checksum contained in the RPM.
-
#verify_checksum(content) ⇒ Object
Verifies if stored MD5 checksum corresponds to digest calculated over given content.
Constructor Details
#initialize(index) ⇒ Signature
Creates a new signature given its components.
13 14 15 |
# File 'lib/rupert/rpm/signature.rb', line 13 def initialize(index) @index = index end |
Instance Method Details
#md5 ⇒ String
MD5 checksum contained in the RPM.
21 22 23 |
# File 'lib/rupert/rpm/signature.rb', line 21 def md5 @index.get MD5_TAG end |
#verify_checksum(content) ⇒ Object
Verifies if stored MD5 checksum corresponds to digest calculated over given content.
30 31 32 |
# File 'lib/rupert/rpm/signature.rb', line 30 def verify_checksum(content) md5 == md5_checksum(content) end |