Crate wecom_crypto

source ·
Expand description

§wecom-crypto

wecom-crypto提供了企业微信API数据的加解密功能。其实现完全遵循官方文档中的规定。

§使用方法

use wecom_crypto::{Agent, Source};

let token = "a";
let key = "cGCVnNJRgRu6wDgo7gxG2diBovGnRQq1Tqy4Rm4V4qF";
let agent = Agent::new(token, key);
let source = Source {
    text: "hello world!".to_string(),
    receive_id: "wandering-ai".to_string(),
};
let enc = agent.encrypt(&source);
let dec = agent.decrypt(enc.as_str()).unwrap();
assert_eq!(source, dec);

Structs§

  • 加解密功能代理。是加解密方法的数据结构载体。
  • 加解密数据结构体。

Enums§

Functions§