#token #media #generator #digital #services #implementation #edgecast

bin+lib ectoken

Token Generator for Edgecast Token-Based Authentication from Verizon Digital Media Services

5 unstable releases

0.3.1 Mar 19, 2021
0.2.2 Jan 6, 2020
0.1.1 Mar 14, 2019

#94 in Multimedia

40 downloads per month

Apache-2.0

11KB
184 lines

CI crates.io Docs

Verizon Digital Media Services

rust-ectoken

Token Generator fo 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.41.0).

Table of Contents

Build

cargo build --release

Test

cargo test

Usage

Library

Add the following to your Cargo.toml.

[dependencies]
ectoken = "^0.3"

CLI

To Encrypt:
  ec_encrypt <key> <text>
or:
  ec_encrypt encrypt <key> <text>

To Decrypt:
  ec_encrypt decrypt <key> <text>

Example

use ectoken;

fn example() {

    let encrypted = ectoken::encrypt_v3("mykey", "mymessage");

    let decrypted = ectoken::decrypt_v3("mykey", &encrypted).unwrap();

    assert_eq!("mymessage", decrypted);
}

Contribute

  • We welcome issues, questions and pull requests.

License

This project is licensed under the terms of the Apache 2.0 open source license. Please refer to the LICENSE-2.0.txt file for the full terms.

Dependencies

~1.5MB
~21K SLoC