0

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!

1 Answer 1

1

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}")
1
  • Ah, lack of an API for that feature explains the lack of documentation, I suppose ;-) I'll look into using something like that, thanks! Nov 15, 2009 at 3:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.