Reputation: 120
what's the Ruby OpenSSL library equivalent of the following command?
openssl pkcs12 -clcerts -nodes -in apns.p12 -out apns.pem
I've been reading through the documentation that I could find, but it's so sparsely documented and I'm not having much luck with that.
Thanks!
Upvotes: 0
Views: 513
Reputation: 75466
No. Ruby OpenSSL doesn't expose enough API to do this. Even in C, we have to write some custom code to accomplish this.
Your best bet is to run openssl from Ruby like this,
system("#{openssl_path}openssl pkcs12 -in #{dir}/#{login}.p12 -out #{dir}/#{login}.cer -clcerts -nokeys -passin pass:#{p12_password}")
Upvotes: 1