There is Apple payment token decoder implementation
Payment token structure described over there https://developer.apple.com/library/archive/documentation/PassKit/Reference/PaymentTokenJSON/PaymentTokenJSON.html
The library does not implement check token signature, it does only
- fetch merchant id from OID 1.2.840.113635.100.6.32
- parse public (ephemeral) key from token field which named "ephemeralPublicKey"
- load private key and certificate (which you've signed it from apple developer service)
- decoding token to json
###Tests
You can run up tests just call go test ./...
, all need files inside the resources folder already
###Links implementation on some languages