pub struct HmacSigner;Expand description
HMAC-SHA256 API 签名器
对参数按字典序排序后拼接成 query string,再用 HMAC-SHA256 签名。
§安全说明(v4.8.0 修复 H-1 参数走私)
- key/value 均做 RFC 3986 percent-encoding 后再拼接,消除
{a:1,b:2}与{a:"1&b=2"}的规范串歧义(参数走私); - 调用方必须将时间戳/随机 nonce 作为参数之一参与签名, 并在服务端校验时间窗,否则签名请求仍可被重放。
Implementations§
Source§impl HmacSigner
impl HmacSigner
Trait Implementations§
Source§impl ApiSigner for HmacSigner
impl ApiSigner for HmacSigner
Auto Trait Implementations§
impl Freeze for HmacSigner
impl RefUnwindSafe for HmacSigner
impl Send for HmacSigner
impl Sync for HmacSigner
impl Unpin for HmacSigner
impl UnsafeUnpin for HmacSigner
impl UnwindSafe for HmacSigner
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more