返回顶部
c

cert-decode

Decode and inspect X.509 SSL/TLS certificates. Use when the user asks to read a certificate, parse a PEM file, check certificate expiry, inspect a TLS cert, view Subject Alternative Names, or decode a .crt/.pem file.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
99
下载量
0
收藏
概述
安装方式
版本历史

cert-decode

# Cert Decode Parse and display human-readable details from X.509 PEM certificates using `openssl`. ## Input - PEM certificate content (text starting with `-----BEGIN CERTIFICATE-----`) pasted directly, OR - Path to a `.pem` or `.crt` file, OR - Hostname to fetch the live certificate from (e.g., `example.com`) ## Output - Subject (CN, O, OU, C) - Issuer (CA name, organization) - Validity: Not Before / Not After (expiry date) - Serial number - Subject Alternative Names (SANs) - Public key algorithm and size - Signature algorithm - Whether the cert is expired or expiring soon ## Instructions 1. Determine input type: pasted PEM text, file path, or hostname. 2. **From pasted PEM text:** Write the PEM content to a temp file, then: ``` echo "PEM_CONTENT" | openssl x509 -text -noout ``` Or use process substitution if available. 3. **From a file path:** ``` openssl x509 -text -noout -in /path/to/cert.pem ``` 4. **From a live hostname (port 443):** ``` echo | openssl s_client -connect HOSTNAME:443 -servername HOSTNAME 2>/dev/null | openssl x509 -text -noout ``` 5. Extract and present key fields from the `openssl x509 -text` output in a clean, readable format: - **Subject:** parse `Subject:` line - **Issuer:** parse `Issuer:` line - **Valid From:** parse `Not Before:` - **Valid Until:** parse `Not After :` - **Serial:** parse `Serial Number:` - **SANs:** parse `X509v3 Subject Alternative Name:` block for all `DNS:` and `IP Address:` entries - **Key:** parse `Public Key Algorithm:` and key size (e.g., `RSA Public-Key: (2048 bit)`) - **Signature Algorithm:** parse `Signature Algorithm:` 6. Calculate whether the certificate is: - Already expired (Not After is in the past) - Expiring within 30 days (warn the user) - Valid (show days remaining) 7. If `openssl` is not found, tell the user: > "This skill requires `openssl`. Install with: `brew install openssl` (macOS) or `sudo apt install openssl` (Linux)." ## Examples **From file:** **Command:** `openssl x509 -text -noout -in /etc/ssl/cert.pem` **From hostname:** **Command:** `echo | openssl s_client -connect github.com:443 -servername github.com 2>/dev/null | openssl x509 -text -noout` **Sample parsed output:** ``` Subject: CN=github.com, O=GitHub, Inc., C=US Issuer: CN=DigiCert TLS Hybrid ECC SHA384 2020 CA1, O=DigiCert Inc, C=US Valid From: 2024-03-07 Valid Until: 2025-03-06 ⚠ Expires in 14 days Serial: 0a:bc:12:... SANs: github.com, www.github.com Key: EC 256-bit (prime256v1) Signature: ecdsa-with-SHA384 ``` ## Error Handling - `openssl` not found → tell user to install it - Input is not valid PEM → openssl will error with `unable to load certificate`; tell user the input does not appear to be a valid PEM certificate - Hostname unreachable → `openssl s_client` will fail; report connection error and suggest checking the hostname or network - DER format instead of PEM → tell user to convert first with: `openssl x509 -inform DER -in cert.der -out cert.pem` - Certificate chain (multiple certs) → only the first cert is parsed; inform user if they need a specific cert from the chain

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 cert-decode-1776083297 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 cert-decode-1776083297 技能

通过命令行安装

skillhub install cert-decode-1776083297

下载 Zip 包

⬇ 下载 cert-decode v1.0.0

文件大小: 2.21 KB | 发布时间: 2026-4-14 13:58

v1.0.0 最新 2026-4-14 13:58
Initial release of cert-decode: Decode and inspect X.509 SSL/TLS certificates using openssl.

- Accepts PEM content, file path, or hostname as input.
- Parses and presents key certificate details (subject, issuer, validity, serial, SANs, key, signature algorithm).
- Checks certificate expiry status; warns about expiration or shows days remaining.
- Handles errors for missing openssl, invalid input, unsupported formats, connection issues, and certificate chains.
- Clear instructions and example commands included.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部