Crates.io | ectoken |
lib.rs | ectoken |
version | 0.4.4 |
source | src |
created_at | 2019-03-14 12:49:56.636265 |
updated_at | 2022-02-18 19:04:09.522918 |
description | Token Generator for Edgecast Token-Based Authentication |
homepage | https://github.com/EdgeCast/rust-ectoken.git |
repository | https://github.com/EdgeCast/rust-ectoken.git |
max_upload_size | |
id | 120663 |
size | 95,514 |
Token Generator for EdgeCast Token-Based Authentication implemented in Rust
Token-Based Authentication safeguards against hotlinking by adding a token requirement to requests for content secured by it. This token, which must be defined in the request URL's query string, defines the criteria that must be met before the requested content may be served via the CDN. This repository contains source code for a Rust implementation.
Written against Rust 2018. (Minimum rustc version 1.49.0).
cargo build --release
cargo test
Add the following to your Cargo.toml.
[dependencies]
ectoken = "^0.4"
To Encrypt:
ec_encrypt <key> <text>
or:
ec_encrypt encrypt <key> <text>
To Decrypt:
ec_encrypt decrypt <key> <text>
use ectoken;
fn example() {
let encrypted = ectoken::encrypt_v3("mykey", "mymessage");
let decrypted = ectoken::decrypt_v3("mykey", &encrypted).unwrap();
assert_eq!("mymessage", decrypted);
}
We welcome issues, questions and pull requests.
This project is licensed under the terms of the Apache 2.0 open source license. Please refer to the LICENSE-APACHE
file for the full terms.