← 返回
未分类 中文

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,...
解码并检查 X.509 SSL/TLS 证书。当用户要求读取证书、解析 PEM 文件、检查证书到期、检查 TLS 证书等时使用。
ohernandez-dev-blossom ohernandez-dev-blossom 来源
未分类 clawhub v1.0.0 1 版本 100000 Key: 无需
★ 0
Stars
📥 406
下载
💾 0
安装
1
版本
#latest

概述

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.
  1. 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.

  1. From a file path:

```

openssl x509 -text -noout -in /path/to/cert.pem

```

  1. From a live hostname (port 443):

```

echo | openssl s_client -connect HOSTNAME:443 -servername HOSTNAME 2>/dev/null | openssl x509 -text -noout

```

  1. 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:
  1. Calculate whether the certificate is:
    • Already expired (Not After is in the past)
    • Expiring within 30 days (warn the user)
    • Valid (show days remaining)
  1. 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

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-31 05:32 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

it-ops-security

OpenClaw Backup

alex3alex
备份与恢复 OpenClaw 数据。适用于创建备份、设置自动备份计划、从备份恢复或管理备份轮转。处理 ~/.openclaw 目录归档并包含适当的排除规则。
★ 90 📥 31,021
it-ops-security

MoltGuard - Security & Antivirus & Guardrails

thomas-security
MoltGuard — OpenClaw 安全守卫,由 OpenGuardrails 提供。安装后可防止您和您的用户受到提示注入、数据泄露及恶意行为的侵害。
★ 116 📥 30,976
it-ops-security

Free Ride - Unlimited free AI

shaivpidadi
管理OpenClaw的OpenRouter免费AI模型,自动按质量排名模型,配置速率限制备用方案,并更新opencla...
★ 471 📥 78,260