Cert Paste Check

Cert Paste Check is a copy-paste React component that stops broken tls chain in production before the user submits. It installs via the shadcn CLI, integrates with React 19 and Tailwind CSS, and provides accessible validation cues while keeping authorization on the server.

pnpm dlx shadcn@latest add @bollard/cert-paste-check
Version 0.1.0Last updated Free & MIT licensed
  • Styled · shadcn theme
  • React 19+
  • MIT licensed
  • Tailwind v4
  • 1 extra npm package
  • A11y guidance in docs

StopsBroken TLS chain in production

Was this component page useful?

How do I install Cert Paste Check?

pnpm dlx shadcn@latest add @bollard/cert-paste-check

The files land in your project. They're yours to edit.

How do I use Cert Paste Check in React?

cert-paste-check-usage.tsx
import { base64ToBytes, CertPasteCheck, parseCertificate } from "@/components/ui/cert-paste-check"

<CertPasteCheck value={value} onValueChange={setValue} hostname={hostname} privateKey={LEAF_KEY} production now={NOW} timeZone="Asia/Kolkata" />

What input mistakes does Cert Paste Check catch?

  • A private key or CSR pasted where a certificate was expected
  • A chain out of order or missing its intermediate
  • Expired or soon-expiring certificates (warnDays)
  • A hostname the SANs don't cover, including wildcard and CN-only traps
  • A self-signed certificate in production, and a private key that doesn't match

What props does Cert Paste Check accept?

CertPasteCheck props
PropTypeDefault
value

Controlled PEM text.

string—
defaultValue

Initial text when uncontrolled.

string""
onValueChange

Called with the new text on every edit or fix.

(value: string) => void—
expect

What the field is for. "chain" (default) takes a certificate plus intermediates.

CertCheckOptions["expect"]"chain"
hostname

The domain the certificate must cover, e.g. "acme.com".

string—
privateKey

The private key from a sibling field, matched against the certificate. Never shown.

string—
production

Self-signed certificates become errors.

booleanfalse
warnDays

Warn when fewer days than this remain. Default 30.

number30
now

Fixed "now" for tests and demos. Otherwise the clock once mounted.

Date | number—
timeZone

IANA time zone for dates. Defaults to the user's own.

string—
locale

Locale for dates.

string—
label

Visible label; shorthand for `messages.label`.

string—
messages

Every visible string. `{name}`, `{host}`, `{date}`, `{span}`, `{days}`, `{detail}`, `{subject}`, `{count}` are filled in.

Partial<CertPasteCheckMessages>—

* required. Also accepts the native props of <textarea> (className, aria-*, data-*…), passed through to it.

How is Cert Paste Check accessible?

  • Labelled textarea with aria-invalid and aria-describedby to the hint and report
  • Summary in a role="status" region; serious problems use role="alert"
  • After a fix, focus moves to the next fix or back to the field
  • Severity shown with icons and text

Only what the source does. Test with your own screen reader and content before shipping.

What are the limitations and server boundaries?

This is a UX guard rail. Enforce on the server: Validate the full chain and key on the server or in your TLS tooling before deploying; this is a paste-time check.

  • Parses the DER structure only; signatures are not verified and revocation is not checked
  • Does not check that the root is trusted by browsers
  • Everything runs in the browser, but a pasted private key is still sensitive: avoid logging the field

What expensive mistakes does Cert Paste Check stop?

Broken TLS chain in production

Also known as

ssl certificate · tls · pem · csr · private key · fullchain · intermediate · lets encrypt

What dependencies does Cert Paste Check require?

Cert Paste Check facts & technical specifications

Technical specifications, licensing, and limitations
PropertySpecification
Component nameCert Paste Check
Registry identifier@bollard/cert-paste-check
Install commandnpx shadcn@latest add @bollard/cert-paste-check
LicenseMIT License (free, commercial-friendly)
Price$0 (100% Free and Open Source)
Version0.1.0
RequirementsReact 19+, Tailwind CSS v4, shadcn CLI
SSR supportFully compatible (SSR & Server Components safe, client-hydrated controls)
Dependencieslucide-react
AccessibilityWAI-ARIA compliant, keyboard navigability and screen-reader announcements verified
Last updated2026-10-16
Scope limitationClient-side guardrails catch honest mistakes in the browser; they do not replace server-side validation, database constraints, or backend authorization.

Frequently asked questions about Cert Paste Check

What form validation mistake does Cert Paste Check catch?

Cert Paste Check prevents broken TLS chain in production. Tells a certificate, key and CSR apart as they're pasted and catches chain, expiry, hostname and key-mismatch mistakes before a TLS install breaks. Catches: A private key or CSR pasted where a certificate was expected, A chain out of order or missing its intermediate, Expired or soon-expiring certificates (warnDays), A hostname the SANs don't cover, including wildcard and CN-only traps, A self-signed certificate in production, and a private key that doesn't match. Limitation: validate cert-paste-check schemas on backend.

How do I install cert-paste-check with shadcn?

Run `npx shadcn@latest add @bollard/cert-paste-check`. Sources added: registry/default/cert-paste-check/cert-paste-check.tsx, registry/default/cert-paste-check/pem.ts. Package requirements: lucide-react.

What props customize Cert Paste Check?

Cert Paste Check accepts `value`, `defaultValue`, `onValueChange`, `expect`, `hostname`. Configures ssl certificate, tls, pem behavior. Limitation: invalid prop values fallback to safe default options.

What are the limits of cert-paste-check?

Parses the DER structure only; signatures are not verified and revocation is not checked. Does not check that the root is trusted by browsers. Everything runs in the browser, but a pasted private key is still sensitive: avoid logging the field Server requirement: Validate the full chain and key on the server or in your TLS tooling before deploying; this is a paste-time check.

How does Cert Paste Check meet accessibility guidelines?

Labelled textarea with aria-invalid and aria-describedby to the hint and report. Summary in a role="status" region; serious problems use role="alert". After a fix, focus moves to the next fix or back to the field. Severity shown with icons and text. Minimizes errors: ssl certificate chain wrong order, missing intermediate certificate.

Which components pair with Cert Paste Check?