Skip to main content
Glama

CipherHUB Cryptography Toolkit

sm9_extract_key

[sm9_ibc] [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'。

Input Schema

TableJSON 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. Dates show when Glama detected each change.

  1. Added

TDQS

A4.6/5.0
Behavior5/5

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

With no annotations provided, the description carries full behavioral disclosure and does so thoroughly. It reveals that GmSSL encrypted PEM import has no password check, that wrong passwords may silently produce garbage keys, that a built-in N-1 probe performs a sign/encrypt round-trip verification (probe_verified=true) before output, and that a wrong password yields the error 'SM9 extract user key failed'. This is far beyond a typical description.

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?

The description is dense but front-loaded with purpose and standard, then lists inputs, then explains the verification probe and outputs. Every sentence adds non-redundant information. It is slightly marred by the duplicated '[sm9_ibc]' prefix, which is a minor formatting flaw, but overall it is efficiently structured.

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?

For a crypto key-extraction tool with no annotations and no output schema, the description is remarkably complete: it covers input semantics, the prerequisite relationship to GenerateSm9, the verification mechanism, the output (user_private_key_in_pem), and the failure mode. Nothing needed for a caller to use the tool correctly is missing.

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. The description adds meaningful semantics beyond the schema: master_private_key_in_pem must be GenerateSm9 output, private_key_password is reused to encrypt the extracted user key, and identity is the being-issued user's identifier bounded to 1-63 UTF-8 bytes. These extra details clarify parameter relationships that schema descriptions do not fully convey.

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 specifies a clear verb and resource: KGC extracts SM9 user private key by identifier (GM/T 0044). It differentiates from siblings by explicitly sourcing master_private_key_in_pem from GenerateSm9 output and by positioning the tool as the key-issuance step, distinct from sm9_sign/verify/encryption/decryption which consume the key.

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 conveys clear usage context: it is the KGC-side step to derive a user key from an already-generated encrypted master key, with identity and key_kind as the distinguishing inputs. It implicitly distinguishes from generate_sm9 by naming the master key as a required input, though it does not explicitly state when not to use this tool or name alternatives.

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.

TDQS

A3.9/5.0
Disambiguation4/5

Most tools target a distinct algorithm+operation pair (e.g., rsa_sign vs sm2_sign vs ml_dsa_sign), and descriptions are detailed. However, block_cipher and stream_cipher both perform symmetric encryption, and ecc_key_exchange and hybrid_kex overlap as key exchange, requiring careful reading to distinguish.

Naming Consistency3/5

Naming is inconsistent across algorithm families: key generation mixes generate_ecc/generate_rsa with ml_dsa_keygen/ml_kem_keygen, and encryption mixes rsa_encryption/sm2_encryption with block_cipher/stream_cipher. Within each family (e.g., rsa_sign/rsa_verify, ml_dsa_sign/ml_dsa_verify), names are predictable, but the overall pattern is not uniform.

Tool Count2/5

32 tools is far above the typical 3-15 range for a well-scoped server. While every tool has a distinct function, the large surface makes the set heavy and harder to navigate, especially with multiple algorithm families and niche utilities.

Completeness5/5

The toolkit gives comprehensive coverage: key generation, encryption/decryption, signing/verification for RSA, ECC, SM2, ML-DSA, ML-KEM, plus symmetric ciphers, hashing, and key exchange. Full workflows are supported with no dead ends, and even helper tools for debugging are included.