X.509: Private / Public Key

前端 未结 3 1532
自闭症患者
自闭症患者 2020-12-07 17:56

We\'re trying to implement some functionality of a Web-Service from one of our partners. Now, the content which is beeing transmitted, should be encrypted with a public key,

3条回答
  •  温柔的废话
    2020-12-07 18:13

    Create a private-public key pair.

    openssl req -x509 -newkey rsa:2048 -keyout private.key -out public.cert -days 365
    

    Optionally, combine the pair into a single file.

    openssl pkcs12 -export -inkey private.key -in public.cert -out certificate.pfx
    

    This results in the following files.

    private.key
    certificate.pfx
    public.cert
    

    See also

    • https://www.openssl.org/docs/manmaster/apps/req.html
    • https://www.openssl.org/docs/manmaster/apps/pkcs12.html
    • https://serverfault.com/questions/9708/what-is-a-pem-file-and-how-does-it-differ-from-other-openssl-generated-key-file

提交回复
热议问题