Self-Signed Certificate Generator
Create a self-signed X.509 certificate and its private key for local development, testing and internal services. Enter a common name and optional extra domain names or IP addresses, choose an ECDSA or RSA key and a validity period, and copy the PEM certificate and PKCS#8 private key.
Frequently asked questions
What is a self-signed certificate for?
For HTTPS on localhost, test servers, internal tools and devices where a public certificate authority is not needed. Browsers and clients do not trust it by default, so you either accept a warning or add the certificate to the trust store of the machines that use it.
What goes into the certificate?
The subject with your common name and optional organization and country, the subject alternative names, basic constraints marking it as an end-entity certificate, key usage for digital signatures and key encipherment, extended key usage for TLS servers and clients, and a subject key identifier.
Why do I need subject alternative names?
Browsers check the hostname against the subject alternative names, not the common name. The common name is added automatically if it is a domain or IP address, and you can list more, such as localhost, 127.0.0.1 or *.example.test.
Which key type should I choose?
ECDSA P-256 is fast, small and supported everywhere TLS 1.2 or later is, which makes it a good default. Choose RSA 2048 or 3072 for old clients or software that only accepts RSA keys.
How long can the certificate be valid?
From 1 to 3650 days. Apple platforms and browsers reject server certificates valid for more than 398 days only when they come from public authorities, but shorter lifetimes are still good practice for anything that leaves your machine.
Is the private key stored?
No. The key pair is generated for this request and returned once. Keep the private key secret, and for production services prefer generating keys on the server that uses them.