Skip to main content
Glama

CipherHUB Cryptography Toolkit

cert_verify

Read-only

[cert] 按 openssl verify 的语义验证证书链。certificate_in_pem:第一张为待验证证书,其后各张为中间证书候选(相当于 openssl verify 的 target 加 -untrusted);ca_certificate_in_pem:信任锚集合,可放根 CA 与中间 CA 的整包(相当于 -CAfile)。链从待验证证书向信任锚逐级构建:签发方 DN、AKI/SKI(两侧都有则必须相等,不符的候选被排除)、签名可由上级公钥验证、上级具备 CA 资格(basicConstraints、keyUsage 含 keyCertSign)并满足 pathLen 约束;任一证书为自签且本身在信任锚集合中时链在自身闭合。chain_verified 汇总链构建与全部签名、CA 规则检查;time_valid 检查链上每张证书的有效期;verified = chain_verified and time_valid。失败时 reason 给出原因与失败深度 failure_depth,chain 回显已建立的路径。不做吊销、名称约束与策略检查。GM 证书(签名 OID 落在 1.2.156.10197 国密分支)逐级走 GmSSL C 的 x509_cert_verify_by_ca_cert(SM2withSM3,与 gmssl certverify CLI 同一函数),sm2_id 为签名者 ID(默认 '1234567812345678',与 GmSSL SM2_DEFAULT_ID 同源,GM/T 0009 默认值,1~64 字节);国际证书逐级走 cryptography 的 verify_directly_issued_by(RSA/EC/Ed25519 等)。verified=false 是成功响应(reason 区分无信任锚、签名失败、CA 资格、pathLen 与有效期),仅输入格式非法才返回错误码 'Certificate verify failed'。

Tool call template

This tool declares no required parameters. Add optional parameters from the input schema as needed.

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "tools/call",
  "params": {
    "arguments": {},
    "name": "cert_verify"
  }
}

Input Schema

NameRequiredDescriptionDefault
sm2_idNoSM2 签名者 ID(仅 GM 证书验证使用;默认 '1234567812345678',GM/T 0009 与 GmSSL 同源默认值,1~64 字节)1234567812345678
certificate_in_pemNo证书的 PEM 文本(含 BEGIN/END CERTIFICATE 头尾);cert_parse 与 cert_verify 均可传多张证书:第一张为待验证证书,其后的中间证书作为候选(叶子在前,合计≤32KB)
ca_certificate_in_pemNo信任锚 CA 证书的 PEM 文本(含 BEGIN/END CERTIFICATE 头尾);可传多张组成的信任锚集合(合计≤32KB)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed2 schema fields changed
    • changedInput schema / properties / ca_certificate_in_pem / description
      Previous value: -"CA 证书的 PEM 文本(含 BEGIN/END CERTIFICATE 头尾,≤10KB)"New value: +"信任锚 CA 证书的 PEM 文本(含 BEGIN/END CERTIFICATE 头尾);可传多张组成的信任锚集合(合计≤32KB)"
    • changedInput schema / properties / certificate_in_pem / description
      Previous value: -"证书的 PEM 文本(含 BEGIN/END CERTIFICATE 头尾);cert_parse 可传多张证书的整链(叶子在前,合计≤32KB),cert_verify 为单张≤10KB"New value: +"证书的 PEM 文本(含 BEGIN/END CERTIFICATE 头尾);cert_parse 与 cert_verify 均可传多张证书:第一张为待验证证书,其后的中间证书作为候选(叶子在前,合计≤32KB)"
  2. Changed1 schema field changed
    • changedInput schema / properties / certificate_in_pem / description
      Previous value: -"终端实体证书的 PEM 文本(含 BEGIN/END CERTIFICATE 头尾,≤10KB)"New value: +"证书的 PEM 文本(含 BEGIN/END CERTIFICATE 头尾);cert_parse 可传多张证书的整链(叶子在前,合计≤32KB),cert_verify 为单张≤10KB"
  3. Added

TDQS

A4.6/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Beyond the readOnlyHint/openWorldHint annotations it discloses substantial behavior: chain-building steps (issuer DN, AKI/SKI matching, signature verification, CA资格 checks, pathLen, self-signed closure), the GM vs international code paths (GmSSL x509_cert_verify_by_ca_cert vs cryptography verify_directly_issued_by), and crucially that verified=false is a successful response while only malformed input yields an error code. This is exactly the kind of context annotations cannot convey.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

It is a single dense paragraph, but it is front-loaded with the core purpose and every clause carries information (chain rules, scope exclusions, failure semantics). Slightly long and could be split, but there is little wasted wording.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

With no output schema, the description compensates by explaining the return fields (chain_verified, time_valid, verified, reason, failure_depth, chain) and the success-on-failure convention. Together with full parameter documentation this leaves nothing material missing for correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, so the baseline is 3, but the description adds real meaning by mapping certificate_in_pem ordering to openssl's target plus -untrusted semantics and ca_certificate_in_pem to -CAfile. sm2_id semantics are also restated (default ID, 1~64 bytes) though mostly duplicate the schema description, keeping it just below a 5.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description opens with a precise verb+resource ('按 openssl verify 的语义验证证书链') and scopes it against the sibling cert_parse by describing chain verification versus parsing. An agent can identify this as the chain-validation tool without reading the schema.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

It explicitly states the verification semantics borrowed from openssl verify and draws boundaries on what is out of scope (no revocation, no name constraints, no policy checks), which helps an agent know when this tool is insufficient. It does not explicitly point to a preferred alternative for the excluded checks, so it falls short of a full 5.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Try in Browser

Glama MCP Gateway

Add one secure layer between your agents and this server.