Class: Moxml::Signature::ReferenceResult

Inherits:
Object
  • Object
show all
Defined in:
lib/moxml/signature/reference_result.rb

Overview

Per-reference digest comparison result. valid? is true iff the freshly-computed digest matches the expected DigestValue.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri:, digest_method:, expected:, computed:) ⇒ ReferenceResult

Returns a new instance of ReferenceResult.



10
11
12
13
14
15
# File 'lib/moxml/signature/reference_result.rb', line 10

def initialize(uri:, digest_method:, expected:, computed:)
  @uri = uri
  @digest_method = digest_method
  @expected = expected
  @computed = computed
end

Instance Attribute Details

#computedObject (readonly)

Returns the value of attribute computed.



8
9
10
# File 'lib/moxml/signature/reference_result.rb', line 8

def computed
  @computed
end

#digest_methodObject (readonly)

Returns the value of attribute digest_method.



8
9
10
# File 'lib/moxml/signature/reference_result.rb', line 8

def digest_method
  @digest_method
end

#expectedObject (readonly)

Returns the value of attribute expected.



8
9
10
# File 'lib/moxml/signature/reference_result.rb', line 8

def expected
  @expected
end

#uriObject (readonly)

Returns the value of attribute uri.



8
9
10
# File 'lib/moxml/signature/reference_result.rb', line 8

def uri
  @uri
end

Instance Method Details

#valid?Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/moxml/signature/reference_result.rb', line 17

def valid?
  expected == computed
end