Recently I started to work on Apple app store receipt validation and due to the deprecation of the legacy /verifyReceipt
endpoint, I decided to go for on-device validation. The guideline described gives a step-by-step solution for MacOS
however we want to perform this validation in the backend service using NodeJs. For the purpose of this validation information defined in the PCKS7#
container is required to be decoded. Here my knowledge comes short as I am unable to retrieve this information (e.g. receipt_creation_data
, bundle_id
) I managed to convert the receipt from PCKS7
to ASN.1
but could not find a way to retrieve the actual key values from it. I tried several libraries like node-forge
, asn1js
, asn1.js
. What I found really useful were these resources:
- iap-local-receipt - Python implementation of the exact problem
- https://github.com/tamtamchik/app-store-receipt-parser - shows a possible way of parsing Apple-store receipt
- https://lapo.it/asn1js/ - tool converting
PKCS#7
toASN.1
AFAIK the information should be encoded in OCTET STRING format
How can information such as bundle_id
or receipt_creation_date
be retrieved from ASN.1 using Javascript?
from How to decode PKCS#7/ASN.1 using Javascript?
No comments:
Post a Comment