Every TLS certificate starts with a certificate signing request: a small, signed file that says "this is my public key, and these are the names I want on the certificate". Making one usually means a long openssl req command and a careful look at the output to check you got the names right.

I built CSR Studio to make that one screen: pick a key, fill in the subject and the domain names, and get back a valid CSR, with the matching openssl command shown alongside for anyone who wants to do it by hand. It runs live as PQCert, and the source is on GitHub.

A personal project, not a product of my employer.

What it does

  • Generate: RSA (2048, 3072, 4096) or ECDSA (P-256, P-384), signed with SHA-256, 384 or 512. The private key comes out as PKCS#8, or as traditional PKCS#1 for RSA. Multi-domain SANs, with DNS names and IP addresses detected automatically, and a key-strength meter.
  • Decode and inspect: paste any CSR to see its subject, SANs, key and whether the signature is valid, and optionally check that a private key matches it.
  • Post-quantum keys: the live app offers ML-DSA, the lattice-based signature scheme NIST standardised for the post-quantum era.

The stack

Layer What runs there
Interface React and Vite: generate, decode, history
Service Spring Boot 3 on Java 21, async jobs
Crypto Bouncy Castle
Data PostgreSQL through JPA, never private keys

Building the CSR

The core is short. Bouncy Castle does the ASN.1; the service decides what goes in. This is the build step from CsrService.java:

KeyPair keyPair = keyPairService.generate( req.keyAlgorithm(), req.keySize(), req.ecCurve()); String sigAlgo = resolveSignatureAlgorithm(req); X500Name subject = buildSubject(req.subject()); JcaPKCS10CertificationRequestBuilder builder = new JcaPKCS10CertificationRequestBuilder(subject, keyPair.getPublic()); addExtensions(builder, req); ContentSigner signer = new JcaContentSignerBuilder(sigAlgo) .setProvider(BouncyCastleProvider.PROVIDER_NAME) .build(keyPair.getPrivate()); return new Built(builder.build(signer), keyPair, sigAlgo); 

One detail worth calling out: the common name is optional. Browsers have long relied on the Subject Alternative Name extension rather than the CN, so a CSR that carries only SANs is perfectly valid, and the builder only adds the subject fields that are filled in.

Post-quantum keys with almost no extra code

Classic keys each need their own setup, an RSA size or an EC curve. For the post-quantum schemes, Bouncy Castle names the key generator after the parameter set itself, so one method covers them all:

/** Post-quantum keygen — the BC algorithm name is the parameter set itself. */ private KeyPair generatePqc(String algorithmName) throws NoSuchAlgorithmException, NoSuchProviderException { if (algorithmName == null || algorithmName.isBlank()) { throw new NoSuchAlgorithmException("Missing PQC parameter set"); } KeyPairGenerator kpg = KeyPairGenerator.getInstance(algorithmName, BouncyCastleProvider.PROVIDER_NAME); return kpg.generateKeyPair(); } 

Pass "ML-DSA-65" and you get an ML-DSA key pair. The same switch also routes SLH-DSA and Falcon through this method.

Slow keys and flaky networks

A 4096-bit RSA key can take long enough to notice. So the generate endpoint has an async mode: POST /api/csr/generate?async=true answers 202 with a job id, and the interface polls GET /api/csr/jobs/{jobId} and shows a live progress stepper.

Retries are where async APIs usually go wrong: a request times out, the client sends it again, and now there are two jobs. Each generate call can carry an Idempotency-Key header. For an async call the server hands back the existing job for a key it has already seen; for a normal call it returns the cached result. Either way, a retry never produces a second key pair.

History without the secrets

Being able to come back to a CSR you made last week is useful. Keeping private keys around is not. In connected mode the history lives in PostgreSQL and stores the CSR and its metadata only, never the private key. Without a backend, the app runs in a demo mode that keeps history in the browser.

To be clear about the trade-off in this build: keys are generated on the server and returned over the API, so you can download them. For production use they belong in a KMS or HSM and should never leave it; the repo's BACKEND_PLAN.md covers that.

Tested end to end

The backend has 35 tests: key generation, CSR building, parsing, validation, key matching, PEM, DER and PKCS#12 conversion, the API contract, the async job lifecycle, idempotency and the error format. A typical one generates a CSR and parses it straight back:

CsrResponse r = csr.generate(CryptoTestSupport.rsaRequest("example.com")); assertThat(r.csrPem()).startsWith("-----BEGIN CERTIFICATE REQUEST-----"); assertThat(r.signatureAlgorithm()).isEqualTo("SHA256withRSA"); var parsed = parser.parse(r.csrPem()); assertThat(parsed.signatureValid()).isTrue(); assertThat(parsed.subjectFields()).containsEntry("commonName", "example.com"); 

Try it

I'm Avinash Chavan, a full-stack engineer in Bengaluru: Java and Spring Boot behind, React and TypeScript in front. More of my work is at avinashchavan.com.