Class: Akami::WSSE::VerifySignature
Defined Under Namespace
Classes: InvalidDigest, InvalidSignedValue
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from C14nHelper
#canonicalize
#at_xpath, #local_name_xpath, #xpath
Constructor Details
Returns a new instance of VerifySignature.
14
15
16
17
|
# File 'lib/akami/wsse/verify_signature.rb', line 14
def initialize(response_body)
@response_body = response_body
@document = create_document
end
|
Instance Attribute Details
#document ⇒ Object
Returns the value of attribute document.
12
13
14
|
# File 'lib/akami/wsse/verify_signature.rb', line 12
def document
@document
end
|
#response_body ⇒ Object
Returns the value of attribute response_body.
12
13
14
|
# File 'lib/akami/wsse/verify_signature.rb', line 12
def response_body
@response_body
end
|
Instance Method Details
#certificate ⇒ Object
35
36
37
38
|
# File 'lib/akami/wsse/verify_signature.rb', line 35
def certificate
certificate_value = element_for_xpath("//Security/BinarySecurityToken").text.strip
OpenSSL::X509::Certificate.new Base64.decode64(certificate_value)
end
|
#generate_digest(element) ⇒ Object
19
20
21
22
23
|
# File 'lib/akami/wsse/verify_signature.rb', line 19
def generate_digest(element)
element = element_for_xpath(element) if element.is_a? String
xml = canonicalize(element)
digest(xml).strip
end
|
#signature_value ⇒ Object
30
31
32
33
|
# File 'lib/akami/wsse/verify_signature.rb', line 30
def signature_value
element = element_for_xpath("//Security/Signature/SignatureValue")
element ? element.text : ""
end
|
#supplied_digest(element) ⇒ Object
25
26
27
28
|
# File 'lib/akami/wsse/verify_signature.rb', line 25
def supplied_digest(element)
element = element_for_xpath(element) if element.is_a? String
find_digest_value element.attributes["Id"]
end
|