user15968687
user15968687

Reputation:

Read a PKCS12 in Ruby

I tried running this code to parse a PKCS12 but for some reason, It didn't run and it gave me this error.

Does any one know a fix to this?

The Error:

main.rb:4:in `initialize': PKCS12_parse: mac verify failure (OpenSSL::PKCS12::PKCS12Error)
        from main.rb:4:in `new'
        from main.rb:4:in `<main>'

The code:

require 'openssl'


  pkcs12 = OpenSSL::PKCS12.new(File.read("cert.p12"), "AppleP12.com")

  puts pkcs12.key

Upvotes: 0

Views: 138

Answers (0)

Related Questions