Class: ZATCA::UBL::Signing::Signature
- Inherits:
-
BaseComponent
- Object
- BaseComponent
- ZATCA::UBL::Signing::Signature
- Defined in:
- lib/zatca/ubl/signing/signature.rb
Constant Summary
Constants inherited from BaseComponent
BaseComponent::ArrayOfBaseComponentOrNil
Instance Attribute Summary collapse
-
#cert_digest_value ⇒ Object
readonly
Returns the value of attribute cert_digest_value.
-
#cert_issuer_name ⇒ Object
readonly
Returns the value of attribute cert_issuer_name.
-
#cert_serial_number ⇒ Object
readonly
Returns the value of attribute cert_serial_number.
-
#signing_time ⇒ Object
readonly
Returns the value of attribute signing_time.
Attributes inherited from BaseComponent
Instance Method Summary collapse
- #attributes ⇒ Object
- #elements ⇒ Object
-
#initialize(invoice_hash:, signed_properties_hash:, signature_value:, certificate:, signing_time:, cert_digest_value:, cert_issuer_name:, cert_serial_number:) ⇒ Signature
constructor
A new instance of Signature.
- #name ⇒ Object
Methods inherited from BaseComponent
#[], build, #build_xml, #dig, #find_nested_element_by_path, #generate_xml, #schema, #to_h, #to_xml
Constructor Details
#initialize(invoice_hash:, signed_properties_hash:, signature_value:, certificate:, signing_time:, cert_digest_value:, cert_issuer_name:, cert_serial_number:) ⇒ Signature
Returns a new instance of Signature.
4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/zatca/ubl/signing/signature.rb', line 4 def initialize( invoice_hash:, signed_properties_hash:, signature_value:, certificate:, signing_time:, cert_digest_value:, cert_issuer_name:, cert_serial_number: ) super() @invoice_digest = invoice_hash @signed_properties_hash = signed_properties_hash @signature_value = signature_value @certificate = certificate @signing_time = signing_time @cert_digest_value = cert_digest_value @cert_issuer_name = cert_issuer_name @cert_serial_number = cert_serial_number end |
Instance Attribute Details
#cert_digest_value ⇒ Object (readonly)
Returns the value of attribute cert_digest_value.
2 3 4 |
# File 'lib/zatca/ubl/signing/signature.rb', line 2 def cert_digest_value @cert_digest_value end |
#cert_issuer_name ⇒ Object (readonly)
Returns the value of attribute cert_issuer_name.
2 3 4 |
# File 'lib/zatca/ubl/signing/signature.rb', line 2 def cert_issuer_name @cert_issuer_name end |
#cert_serial_number ⇒ Object (readonly)
Returns the value of attribute cert_serial_number.
2 3 4 |
# File 'lib/zatca/ubl/signing/signature.rb', line 2 def cert_serial_number @cert_serial_number end |
#signing_time ⇒ Object (readonly)
Returns the value of attribute signing_time.
2 3 4 |
# File 'lib/zatca/ubl/signing/signature.rb', line 2 def signing_time @signing_time end |
Instance Method Details
#attributes ⇒ Object
21 22 23 24 25 26 |
# File 'lib/zatca/ubl/signing/signature.rb', line 21 def attributes { "xmlns:ds" => "http://www.w3.org/2000/09/xmldsig#", "Id" => "signature" } end |
#elements ⇒ Object
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
# File 'lib/zatca/ubl/signing/signature.rb', line 32 def elements [ ZATCA::UBL::Signing::SignedInfo.new( invoice_digest: @invoice_digest, signed_properties_hash: @signed_properties_hash ), ZATCA::UBL::BaseComponent.new(name: "ds:SignatureValue", value: @signature_value), ZATCA::UBL::Signing::KeyInfo.new(certificate: @certificate), ZATCA::UBL::Signing::Object.new( signing_time: @signing_time, cert_digest_value: @cert_digest_value, cert_issuer_name: @cert_issuer_name, cert_serial_number: @cert_serial_number ) ] end |
#name ⇒ Object
28 29 30 |
# File 'lib/zatca/ubl/signing/signature.rb', line 28 def name "ds:Signature" end |