agentleFS
AI-Shell-TeamAI-Shell-Team/aish/skills/ssl-cert-toolkit/SKILL.md

ssl-cert-toolkit

Skill578 starsChanged 6 months agoApache-2.0View on GitHub

Local SSL/TLS certificate toolkit using openssl: inspect certificates, check key/cert/CSR match, generate CSRs, convert PEM/PFX, and run simple chain checks. No cloud certificate APIs. Also matches Chinese requests such as SSL 证书、 证书匹配、生成 CSR、转换证书格式、检查证书.

The file

We split this skill into the rules it gives an agent

4 rules. About 0 are common, 2 are distinctive, and 2 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈2

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 2

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Very specific:

    Use openssl on this host to inspect certificates, verify key/cert/CSR pairing, generate CSRs, convert common formats, and run simple …

    line 41
  2. Very specific:

    Protect private keys: never paste key material into chat.

    line 49
  3. Distinctive:

    Stop when enough: after match/inspect succeeds, do not “optimize” unrelated files.

    line 51
  4. Distinctive:

    Fail closed on match: if OpenSSL cannot parse an input, report that—never treat empty digests as MATCH.

    line 52

≈ “Common” is an estimate: at least 1 in 5 of the 364,980 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

SSL certificate toolkit

Use openssl on this host to inspect certificates, verify key/cert/CSR pairing, generate CSRs, convert common formats, and run simple validation.

Out of scope: cloud purchase/upload/deploy APIs, silently changing the system trust store, submitting CA requests for the user.

Rules

  1. Clarify intent first: inspect / match / generate CSR / convert / verify—ask if unclear.
  2. Confirm before writing files: confirm output paths; do not overwrite existing files unless asked.
  3. Protect private keys: never paste key material into chat; suggest mode 0600; do not log key bodies.
  4. Dependency: require openssl (command -v openssl). keytool only for JKS.
  5. Stop when enough: after match/inspect succeeds, do not “optimize” unrelated files.
  6. Fail closed on match: if OpenSSL cannot parse an input, report that—never treat empty digests as MATCH.

Capabilities

IntentExample asks
Inspectvalidity dates, SAN, issuer
Matchare cert and key a pair; does CSR match
Generate CSRcreate CSR to get a signed cert
ConvertPEM ↔ PFX/P12, split chain
Verifychain OK, expired or not

Inspect

openssl version
openssl x509 -in <cert.pem> -noout -subject -issuer -dates -ext subjectAltName 2>/dev/null
openssl x509 -in <cert.pem> -noout -text | head -80

For PFX, ask for the password; prefer -passin env:CERT_PASS over putting secrets on the command line:

openssl pkcs12 -in <file.pfx> -nokeys -clcerts -passin env:CERT_PASS

Match check (cert / key / CSR)

Compare public keys (preferred) or RSA moduli. Each openssl extract must succeed and produce non-empty output before comparing:

openssl x509 -in <cert.pem> -noout -pubkey | openssl md5
openssl pkey -in <key.pem> -pubout | openssl md5
openssl req -in <csr.pem> -noout -pubkey | openssl md5   # if CSR given

Parse failure or empty digest → not MATCH. Equal non-empty digests → MATCH.
Optional: openssl req -in <csr.pem> -noout -verify (CSR signature; separate from key match).

Generate CSR

Confirm CN/SAN, algorithm (default RSA 2048), and output directory.

openssl req -new -newkey rsa:2048 -nodes \
  -keyout <domain>.key -out <domain>.csr \
  -subj "/CN=<domain>"

openssl req -in <domain>.csr -noout -text | head -60

With SAN, write a temporary san.cnf (user confirms) then:

openssl req -new -newkey rsa:2048 -nodes \
  -keyout <domain>.key -out <domain>.csr \
  -config san.cnf -extensions v3_req

ECDSA:

openssl ecparam -genkey -name prime256v1 -out <domain>.key
openssl req -new -key <domain>.key -out <domain>.csr -subj "/CN=<domain>"

Remind: do not commit the private key; CSR can go to the CA.

Format conversion

Confirm inputs and target format first.

openssl pkcs12 -export -out <out.pfx> -inkey <key.pem> -in <cert.pem> [-certfile chain.pem]
openssl pkcs12 -in <in.pfx> -clcerts -nokeys -out cert.pem
openssl pkcs12 -in <in.pfx> -nocerts -nodes -out key.pem
openssl x509 -in <file> -noout -subject 2>/dev/null || openssl req -in <file> -noout -subject 2>/dev/null

Handle JKS only if the user asks and keytool exists; otherwise prefer PEM/PFX.

Simple verification

openssl x509 -in <cert.pem> -noout -checkend 0 && echo 'not expired' || echo 'expired or invalid'
openssl verify -CAfile <ca_or_chain.pem> <cert.pem>

Live site (read-only) when the user gives an HTTPS host:

echo | openssl s_client -connect <host>:443 -servername <host> 2>/dev/null | openssl x509 -noout -subject -dates

Output format

## Conclusion
What was done: inspect / match result / generated paths / conversion outputs.

## Evidence
- Relevant openssl output (redacted; no private key body)
- Digest comparison for match checks

## Recommendations
- Next steps (submit CSR, deploy where, `chmod 600`)
- Direction if expired or mismatched

Reply in the user's language.

Related skills

CaseSkill
Domain does not resolvedns-diagnose
Network fails before TLSnetwork-path-diagnose

Example

User: Are server.crt and server.key a pair?

  1. Confirm readable paths
  2. Compare pubkey/modulus digests
  3. Conclude MATCH or name the mismatch

Download now (ZIP)

Does it work?

Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.

No reviews yet

People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.

  • It worked
  • Partly
  • It didn't
What did you use it for? e.g. Reviewing pull requests in a Rails app

Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.

Your trail

Files you open will collect here, so you can find them again.

Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.

Now do this for your own.

Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.