pub struct Agent { /* private fields */ }Expand description
加解密功能代理。是加解密方法的数据结构载体。
Implementations§
Source§impl Agent
impl Agent
Sourcepub fn generate_signature(&self, inputs: &[&str]) -> String
pub fn generate_signature(&self, inputs: &[&str]) -> String
根据请求数据生成签名,用于校验微信服务器的请求是否合规。输入数据不需要包含Token。
§Example
use wecom_crypto::Agent;
let agent = Agent::new("a", "cGCVnNJRgRu6wDgo7gxG2diBovGnRQq1Tqy4Rm4V4qF");
assert_eq!(
agent.generate_signature(&["0", "c", "b"]),
"a8addbc99f8b3f51d2adbceb605d650b9a8940e2"
)Trait Implementations§
Auto Trait Implementations§
impl Freeze for Agent
impl RefUnwindSafe for Agent
impl Send for Agent
impl Sync for Agent
impl Unpin for Agent
impl UnwindSafe for Agent
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