Class: ItunesReceiptDecoder::Decode::TransactionReceipt::SignatureValidation
- Inherits:
-
Object
- Object
- ItunesReceiptDecoder::Decode::TransactionReceipt::SignatureValidation
- Defined in:
- lib/itunes_receipt_decoder/decode/transaction_receipt.rb
Overview
ItunesReceiptDecoder::Decode::TransactionReceipt::SignatureValidation
Instance Attribute Summary collapse
-
#blob ⇒ Object
readonly
Returns the value of attribute blob.
-
#cert_length ⇒ Object
Returns the value of attribute cert_length.
-
#purchase_info ⇒ Object
readonly
Returns the value of attribute purchase_info.
-
#raw_cert ⇒ Object
Returns the value of attribute raw_cert.
-
#signature ⇒ Object
Returns the value of attribute signature.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
-
#initialize(blob, purchase_info) ⇒ SignatureValidation
constructor
A new instance of SignatureValidation.
- #valid? ⇒ Boolean
Constructor Details
#initialize(blob, purchase_info) ⇒ SignatureValidation
Returns a new instance of SignatureValidation.
21 22 23 24 |
# File 'lib/itunes_receipt_decoder/decode/transaction_receipt.rb', line 21 def initialize(blob, purchase_info) @blob = blob @purchase_info = purchase_info end |
Instance Attribute Details
#blob ⇒ Object (readonly)
Returns the value of attribute blob.
18 19 20 |
# File 'lib/itunes_receipt_decoder/decode/transaction_receipt.rb', line 18 def blob @blob end |
#cert_length ⇒ Object
Returns the value of attribute cert_length.
19 20 21 |
# File 'lib/itunes_receipt_decoder/decode/transaction_receipt.rb', line 19 def cert_length @cert_length end |
#purchase_info ⇒ Object (readonly)
Returns the value of attribute purchase_info.
18 19 20 |
# File 'lib/itunes_receipt_decoder/decode/transaction_receipt.rb', line 18 def purchase_info @purchase_info end |
#raw_cert ⇒ Object
Returns the value of attribute raw_cert.
19 20 21 |
# File 'lib/itunes_receipt_decoder/decode/transaction_receipt.rb', line 19 def raw_cert @raw_cert end |
#signature ⇒ Object
Returns the value of attribute signature.
19 20 21 |
# File 'lib/itunes_receipt_decoder/decode/transaction_receipt.rb', line 19 def signature @signature end |
#version ⇒ Object
Returns the value of attribute version.
19 20 21 |
# File 'lib/itunes_receipt_decoder/decode/transaction_receipt.rb', line 19 def version @version end |
Instance Method Details
#valid? ⇒ Boolean
26 27 28 29 30 31 32 |
# File 'lib/itunes_receipt_decoder/decode/transaction_receipt.rb', line 26 def valid? unpack && raw_cert.size == cert_length && cert && cert.verify(public_key) && verify end |