require 'openssl'
if ARGV.length == 2
pkcs12 = OpenSSL::PKCS12.new(File.read(ARGV[0]), ARGV[1])
p pkcs12.certificate
else
puts "Usage: load_cert.rb <path_to_cert> <cert_password>"
end
运行它会在 Windows 上产生错误,但在 linux 上不会。
错误:
OpenSSL::PKCS12::PKCS12Error: PKCS12_parse: mac verify failure
from (irb):21:ininitialize
from (irb):21:innew
from (irb):21
from C:/Ruby192/bin/irb:12:in<main>