Skip to main content
Glama

CipherHUB Cryptography Toolkit

sm9_extract_key

Read-only

[sm9_ibc] KGC 按标识提取 SM9 用户私钥(GM/T 0044)。输入:key_kind(Sign/Enc)、master_private_key_in_pem(GenerateSm9 输出的加密主私钥)、private_key_password(主私钥口令,提取的用户钥也以同一口令加密)、identity(被派发方标识,如邮箱/账号,1-63 UTF-8 字节)。内置 N-1 探针:GmSSL 加密 PEM 导入无口令校验,错口令可能静默解出垃圾主密钥,因此派生后当场完成一次签名验回/加解密往返(probe_verified=true)才输出。输出:user_private_key_in_pem。错口令返回 'SM9 extract user key 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": "sm9_extract_key"
  }
}

Input Schema

NameRequiredDescriptionDefault
identityNoSM9 用户标识(原始字符串,如邮箱/账号,1-63 UTF-8 字节;签名/加密/解密均与该标识绑定)
key_kindNoSM9 主密钥类型,可选值:Sign(签名主密钥)/ Enc(加密主密钥)Enc
private_key_passwordNo私钥的加密密码(原始字符串,非编码格式),可选
master_private_key_in_pemNoSM9 加密主私钥的 PEM 文本(含 BEGIN ENCRYPTED SM9 ... MASTER KEY 头尾,KGC 自留)

Schema Changelog

Changes observed during successful MCP inspections.

  1. Added

TDQS

A4/5.0
Behavior3/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, so the safety profile is covered in structured data. The description adds substantial context beyond that — the GmSSL no-password-verification caveat, the N-1 probe round trip that yields probe_verified=true, and the literal error string on failure. Note this is a key-derivation operation labeled read-only, which is defensible (no state is mutated) but not explained as such.

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?

Front-loaded with purpose, then parameter notes, then the probe caveat, then output and error behavior — a logical order with no filler sentences. It is dense and repeats parameter details already present in a fully described schema, which costs it a point on conciseness.

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 available, the description still names the return field (user_private_key_in_pem) and the exact failure message, and explains the probe-verified flag an agent should check. For a four-parameter derivation tool that is enough to call and interpret it correctly.

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

Parameters3/5

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

Schema coverage is 100%, so all four parameters are already documented and the baseline is 3. The description contributes one genuinely new semantic — that private_key_password also encrypts the extracted user key, not just the master key — while the rest (identity byte range, key_kind values) merely restates the schema.

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?

States a specific verb and resource — KGC derives an SM9 user private key from an identity (GM/T 0044) — and ties the input master key to the GenerateSm9 sibling's output, which cleanly separates it from generate_sm9 and from the sign/encrypt siblings.

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?

The description makes the operating context explicit (KGC-side derivation, master key must come from GenerateSm9, password is reused for the derived key) so an agent knows when this tool applies. It stops short of naming explicit when-not cases or pointing at a sibling for the non-KGC path.

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.