Class: ZATCA::UBL::Signing::SignaturePropertiesReference

Inherits:
BaseComponent
  • Object
show all
Defined in:
lib/zatca/ubl/signing/signature_properties_reference.rb

Constant Summary

Constants inherited from BaseComponent

BaseComponent::ArrayOfBaseComponentOrNil

Instance Attribute Summary collapse

Attributes inherited from BaseComponent

#index, #value

Instance Method Summary collapse

Methods inherited from BaseComponent

#[], build, #build_xml, #dig, #find_nested_element_by_path, #generate_xml, #schema, #to_h, #to_xml

Constructor Details

#initialize(digest_value:) ⇒ SignaturePropertiesReference

Returns a new instance of SignaturePropertiesReference.



4
5
6
7
# File 'lib/zatca/ubl/signing/signature_properties_reference.rb', line 4

def initialize(digest_value:)
  super()
  @digest_value = digest_value
end

Instance Attribute Details

#digest_valueObject

Returns the value of attribute digest_value.



2
3
4
# File 'lib/zatca/ubl/signing/signature_properties_reference.rb', line 2

def digest_value
  @digest_value
end

Instance Method Details

#attributesObject



13
14
15
16
17
18
# File 'lib/zatca/ubl/signing/signature_properties_reference.rb', line 13

def attributes
  {
    "Type" => "http://www.w3.org/2000/09/xmldsig#SignatureProperties",
    "URI" => "#xadesSignedProperties"
  }
end

#elementsObject



20
21
22
23
24
25
# File 'lib/zatca/ubl/signing/signature_properties_reference.rb', line 20

def elements
  [
    ZATCA::UBL::BaseComponent.new(name: "ds:DigestMethod", attributes: {"Algorithm" => "http://www.w3.org/2001/04/xmlenc#sha256"}),
    ZATCA::UBL::BaseComponent.new(name: "ds:DigestValue", value: @digest_value)
  ]
end

#nameObject



9
10
11
# File 'lib/zatca/ubl/signing/signature_properties_reference.rb', line 9

def name
  "ds:Reference"
end