Class: SignedXml::Signature

Inherits:
Object
  • Object
show all
Includes:
DigestMethodResolution, Fingerprinting, Logging
Defined in:
lib/signed_xml/signature.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logging

included, #logger

Methods included from Fingerprinting

#fingerprint

Methods included from DigestMethodResolution

#new_digester_for_id

Constructor Details

#initialize(here) ⇒ Signature

Returns a new instance of Signature.



13
14
15
# File 'lib/signed_xml/signature.rb', line 13

def initialize(here)
  @here = here
end

Instance Attribute Details

#certificate_store=(value) ⇒ Object

Sets the attribute certificate_store

Parameters:

  • value

    the value to set the attribute certificate_store to.



11
12
13
# File 'lib/signed_xml/signature.rb', line 11

def certificate_store=(value)
  @certificate_store = value
end

#hereObject

Returns the value of attribute here.



9
10
11
# File 'lib/signed_xml/signature.rb', line 9

def here
  @here
end

#public_key=(value) ⇒ Object

Sets the attribute public_key

Parameters:

  • value

    the value to set the attribute public_key to.



10
11
12
# File 'lib/signed_xml/signature.rb', line 10

def public_key=(value)
  @public_key = value
end

Instance Method Details

#is_verified?Boolean

Returns:

  • (Boolean)


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

def is_verified?
  is_signed_info_verified? && are_reference_digests_verified?
end

#sign(private_key, certificate = nil) ⇒ Object



21
22
23
24
25
# File 'lib/signed_xml/signature.rb', line 21

def sign(private_key, certificate = nil)
  compute_digests_for_references
  sign_signed_info(private_key)
  set_certificate_data(certificate)
end