Getting OpenSSL::X509::CertificateError nested asn1 error on Ruby

后端 未结 3 1367
情深已故
情深已故 2020-12-11 00:46

I have .p12 file from Apple and tried to convert it to .pem file with following command:

openssl pkcs12 -in cert.p12 -out apple_push_notification_development         


        
3条回答
  •  鱼传尺愫
    2020-12-11 01:18

    I've had the same problem and im my case I needed to decode file content with Base64.

    require 'openssl'
    require 'base64'
    
    encoded_content = File.read('apple_push_notification_development.pem')
    decoded_content = Base64.decode64(encoded_content)
    certificate = OpenSSL::X509::Certificate.new(decoded_content)
    

提交回复
热议问题