Skip to main content

encrypt_token

Function encrypt_token 

Source
pub fn encrypt_token(plaintext: &str) -> Option<String>
Expand description

加密明文 token,返回 nonce‖ct‖tag 的 hex 字符串(存入 token_enc)。

失败仅在不持有有效主密钥时(调用方应在签发前已检查 mcp_enc_key().is_some())。