Openssl Rsa_generate_key_ex Example

Library for working with RSA keys using Elixir and OpenSSL ports.

Openssl req -new -newkey rsa:1024 -nodes -key. Stack Exchange Network Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Installation

If available in Hex, the package can be installed as:

  • Add rsa_ex to your list of dependencies in mix.exs:
  • Ensure rsa_ex is started before your application:

Usage

  • Generate RSA 2048 Private Key
  • Generate RSA 2048 Public Key
  • Generate RSA 4096 Public Key
  • Generate RSA 2048 Private/Public Keypair
  • Generate RSA 4096 Private/Public Keypair
  • Sign message with RSA private key
  • Sign message with RSA private key specifying a custom dygest type
  • Verify signature with RSA public key
  • Verify signature with RSA public key specifying a custom dygest type
  • Encrypt message with RSA public key in base64

Openssl Create Crt And Key

  • Encrypt message with RSA private key in base64
  • Decrypt message with RSA private key
  • Decrypt message with RSA public key

Common OpenSSL Commands with Keys and Certificates

Generate RSA private key with certificate in a single command

Generate Certificate Signing Request (CSR) from private key with passphrase

Openssl Rsa_generate_key_ex Example

Generate RSA private key (2048 bit)

Generate a Certificate Signing Request (CSR)

Generate RSA private key (2048 bit) and a Certificate Signing Request (CSR) with a single command

Convert private key to PEM format

Generate a self-signed certificate that is valid for a year with sha256 hash

View details of a RSA private key

Generate Key With Openssl

View details of a CSR

View details of a Certificate

Openssl Create Private Key

View details of a Certificate in DER format

Convert a DER file (.crt .cer .der) to PEM

Convert a PEM file to DER