Class: SatMx::XmlAuthBody Private
- Inherits:
-
Object
- Object
- SatMx::XmlAuthBody
- Defined in:
- lib/sat_mx/authentication.rb
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Instance Method Summary collapse
- #generate ⇒ Object private
-
#initialize(certificate:, uuid:) ⇒ XmlAuthBody
constructor
private
A new instance of XmlAuthBody.
Constructor Details
#initialize(certificate:, uuid:) ⇒ XmlAuthBody
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of XmlAuthBody.
49 50 51 52 |
# File 'lib/sat_mx/authentication.rb', line 49 def initialize(certificate:, uuid:) @certificate = certificate @uuid = uuid end |
Instance Method Details
#generate ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 |
# File 'lib/sat_mx/authentication.rb', line 54 def generate " <S11:Envelope xmlns:S11=\"http://schemas.xmlsoap.org/soap/envelope/\" xmlns:wsu=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd\">\n <S11:Header>\n <wsse:Security S11:mustUnderstand=\"1\" xmlns:wsse=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd\">\n \#{timestamp}\n <wsse:BinarySecurityToken wsu:Id=\"\#{uuid}\" ValueType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3\" EncodingType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary\">\#{Base64.strict_encode64(certificate.to_der)}</wsse:BinarySecurityToken>\n <Signature xmlns=\"http://www.w3.org/2000/09/xmldsig#\">\n \#{signed_info}\n <SignatureValue></SignatureValue>\n <KeyInfo>\n <wsse:SecurityTokenReference>\n <wsse:Reference ValueType=\"http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-x509-token-profile-1.0#X509v3\" URI=\"#\#{uuid}\" />\n </wsse:SecurityTokenReference>\n </KeyInfo>\n </Signature>\n </wsse:Security>\n </S11:Header>\n <S11:Body>\n <Autentica xmlns=\"http://DescargaMasivaTerceros.gob.mx\" />\n </S11:Body>\n </S11:Envelope>\n XML\nend\n" |