Skip to main content
Glama

CipherHUB Cryptography Toolkit

rsa_sign

Read-only

[rsa] RSA 私钥签名。 【参数】

  • rsa_private_key_in_pem:PEM 格式私钥

  • data_in_hex:待签数据 Hex

  • rsa_sign_padding_mode:RSA_SIGN_PKCS1_V1_5_SHA{1,224,256,384,512} 或 RSA_SIGN_PSS_SHA{1,224,256,384,512}

  • rsa_sign_raw_data_mode:True=对原文签名(内部先哈希),False=data_in_hex 已是摘要值

  • password:若私钥有密码保护则传入 【输出】signature_in_hex、signature_length。 【安全建议】推荐 PSS 而非 PKCS1v1.5。

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": "rsa_sign"
  }
}

Input Schema

NameRequiredDescriptionDefault
passwordNo密码(原始字符串,非编码格式;私钥工具为私钥加密密码,KDF Pbkdf2Sm3 为待拉伸口令)
data_in_hexNo数据的十六进制字符串。RAW 模式为消息原文 Hex,DIGEST 模式为哈希摘要 Hex
rsa_sign_padding_modeNoRSA 签名填充模式,可选值:RSA_SIGN_PKCS1_V1_5_SHA1 / SHA224 / SHA256 / SHA384 / SHA512 或 RSA_SIGN_PSS_SHA1 / SHA224 / SHA256 / SHA384 / SHA512
rsa_private_key_in_pemNoRSA 私钥的 PEM 文本(含 BEGIN/END 头尾的 Base64 编码文本)
rsa_sign_raw_data_modeNoTrue=对原文签名(服务端内部先哈希),False=data_in_hex 已是哈希摘要的 Hex

Schema Changelog

Changes observed during successful MCP inspections.

  1. Changed1 schema field changed
    • changedInput schema / properties / password / description
      Previous value: -"私钥的加密密码(原始字符串,非编码格式)"New value: +"密码(原始字符串,非编码格式;私钥工具为私钥加密密码,KDF Pbkdf2Sm3 为待拉伸口令)"
  2. Changed6 schema fields changed
    • addedInput schema / properties / data_in_hex / description
      Added value: +"数据的十六进制字符串。RAW 模式为消息原文 Hex,DIGEST 模式为哈希摘要 Hex"
    • addedInput schema / properties / password / description
      Added value: +"私钥的加密密码(原始字符串,非编码格式)"
    • addedInput schema / properties / rsa_private_key_in_pem / description
      Added value: +"RSA 私钥的 PEM 文本(含 BEGIN/END 头尾的 Base64 编码文本)"
    • addedInput schema / properties / rsa_sign_padding_mode / description
      Added value: +"RSA 签名填充模式,可选值:RSA_SIGN_PKCS1_V1_5_SHA1 / SHA224 / SHA256 / SHA384 / SHA512 或 RSA_SIGN_PSS_SHA1 / SHA224 / SHA256 / SHA384 / SHA512"
    • addedInput schema / properties / rsa_sign_padding_mode / enum
      Added value: +[
      +  "RSA_SIGN_PKCS1_V1_5_SHA1",
      +  "RSA_SIGN_PKCS1_V1_5_SHA224",
      +  "RSA_SIGN_PKCS1_V1_5_SHA256",
      +  "RSA_SIGN_PKCS1_V1_5_SHA384",
      +  "RSA_SIGN_PKCS1_V1_5_SHA512",
      +  "RSA_SIGN_PSS_SHA1",
      +  "RSA_SIGN_PSS_SHA224",
      +  "RSA_SIGN_PSS_SHA256",
      +  "RSA_SIGN_PSS_SHA384",
      +  "RSA_SIGN_PSS_SHA512"
      +]
    • addedInput schema / properties / rsa_sign_raw_data_mode / description
      Added value: +"True=对原文签名(服务端内部先哈希),False=data_in_hex 已是哈希摘要的 Hex"
  3. First observed

TDQS

A3.7/5.0
Behavior4/5

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

Annotations already declare readOnlyHint=true and openWorldHint=false, and the description adds real context beyond them: the internal-hash behavior in raw mode, the digest-input contract in raw_data_mode=false, password handling for encrypted keys, and a PSS-vs-PKCS1 security recommendation. What it omits is error behavior on key/format mismatch.

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?

Sectioned with 【参数】/【输出】/【安全建议】 headers and front-loads the core purpose, so it scans well. Some parameter bullets duplicate the schema verbatim, which is minor waste but not bloat.

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

Completeness4/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 correctly compensates by naming the return fields signature_in_hex and signature_length. The one real gap: required_parameters is 0 and the text never states that rsa_private_key_in_pem, data_in_hex, and a padding mode are effectively mandatory for a working call.

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 description coverage is 100%, so the baseline is 3. The 【参数】 block largely restates what the schema and enum already say (padding modes, raw mode meaning, PEM format) rather than adding format constraints, defaults, or interdependencies not already documented.

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

Purpose4/5

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

The opening line '[rsa] RSA 私钥签名' names a specific verb and resource (sign with an RSA private key), which is immediately distinguishable from rsa_encryption, rsa_verify, or sm2_sign. It does not explicitly contrast with those siblings, which keeps it from a 5.

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

Usage Guidelines3/5

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

Usage is implied rather than stated: the padding-mode list and the raw-vs-digest switch tell an agent how to call it, and the closing 【安全建议】 recommends PSS over PKCS1v1.5. There is no explicit 'use this instead of X' or prerequisite statement, so guidance is present but not directive.

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.