Skip to main content

decrypt_token

Function decrypt_token 

Source
pub fn decrypt_token(enc_hex: &str) -> Option<String>
Expand description

解密 token_encnonce‖ct‖tag 的 hex)还原明文 token。

失败(密钥缺失、hex 非法、密文被篡改、nonce 长度不符)统一返回 None—— 调用方无法区分具体原因,按「该 token 不可解密」处理(等同于失效)。