美文网首页
OpenSSL生成PEM格式的RSA密钥对

OpenSSL生成PEM格式的RSA密钥对

作者: 大道至简_Andy | 来源:发表于2017-11-08 00:32 被阅读83次

    1. private key

    openssl genrsa -out private.pem 1024

    -----BEGIN RSA PRIVATE KEY-----
    MIICXAIBAAKBgQDDPs8x8VeItcPWNqA+e+cMEjWcXxxwrO4za+SmAuRp9VzchfGF
    SN5djLPC9votlVK8KZTqhEPcRr4AmDrXen7CKBjkD48JCyhPlYV/DrQ1RqaUFCKy
    JEQOG3VHJRvnU6r80uX5k4MI7AfvXpZSXYhsVG3gFJDLqmdfyOKy9HEVPwIDAQAB
    AoGALObk/7dhSi+DOmCVuckE+eG2MqAtCjy7C1hk3UkM/tFO6ehkAyMfAKS7Mrta
    DeGphVyKwuRoNuCOEdTws12YiOeEwC/h6a3XlFheUUGDHp9gO6Qi/6RmihLZpTgU
    DSNUzV8ZYCszIJukVFpV87zXWFcbRaLLNXuoNbwOO8xN5AECQQDo3+PfhBqYw9+x
    GTxC4iShibrfzF6bLu+AqLpF2JEWKnR6hZPGdUMYqUtadVSsvVYnySJRwRsGgo52
    RODeE3vPAkEA1qJQR2Dq6wiLV1VE+SFq0+AO8Gt1pt8QldgZWAotn02zfTi7maJ/
    dcy0WDM7VUr/pPkK+WvQDEopTR0ky7z7kQJAXtW2lfLVZfr2oMeXG+G+ay6MtNEk
    gev2Sx3rZcBRLYaykqbNTFe6sFNZRYhcqFAewusNF+AdImSOoalhLe8fTwJBAMRs
    zT1VtAgezK7DKZk5/PMkRWe/YG+0CxCnMSKCRhhZWt9JsV47+ZwMGCvzzuQS+/y1
    slZrVX45zKx29HrEXBECQDKWIAGVuKkZep1LYn4/dGJsBd+ELM/m8SiIVj5IVDsy
    nDJW1qbyTZk3n6E2A/2SjXJmrqM1Miz7SAEajaiu4oE=
    -----END RSA PRIVATE KEY-----
    

    2. public key

    openssl rsa -in private.pem -pubout -out public.pem

    -----BEGIN PUBLIC KEY-----
    MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDDPs8x8VeItcPWNqA+e+cMEjWc
    XxxwrO4za+SmAuRp9VzchfGFSN5djLPC9votlVK8KZTqhEPcRr4AmDrXen7CKBjk
    D48JCyhPlYV/DrQ1RqaUFCKyJEQOG3VHJRvnU6r80uX5k4MI7AfvXpZSXYhsVG3g
    FJDLqmdfyOKy9HEVPwIDAQAB
    -----END PUBLIC KEY-----
    

    备注:以上命令在MAC上亲测通过。

    相关文章

      网友评论

          本文标题:OpenSSL生成PEM格式的RSA密钥对

          本文链接:https://www.haomeiwen.com/subject/pagsmxtx.html