How to test the APNS p12 certificate environments ruby? -
i'm developing service sending push notifications, can't tell if uploaded apns certificate p12 sandbox or production. test in order avoid human error when uploading certificate.
the common name of issued certificate tells if it's sandbox or production.
example production: apple production ios push services: your.app.identifier
my ruby skills bit rusty should it:
require 'openssl' raw_cert = openssl::pkcs12.new(file.read(path_to_your_cert), your_pwd) # if want read .p12 cert cert = openssl::x509::certificate.new(raw_cert) cert.subject.start_with?("apple production ios")
see here: http://ruby-doc.org/stdlib-2.0.0/libdoc/openssl/rdoc/openssl/x509/certificate.html
Comments
Post a Comment