A rust re-implementation of the Python library itsdangerous
.
Essentially, this crate provides various helpers to pass data to untrusted environments and get it back safe and sound. Data is cryptographically signed to ensure that it has not been tampered with.
Signers
- [
Signer
], a signer that signs/unsigns arbitrary values. - [
TimestampSigner
], a signer that signs/unsigns arbitrary values attaching a signed timestamp so you know when the value was signed.
Basic Example
use Duration;
use ;
// Create a signer using the default builder, and an arbitrary secret key.
let signer = default_builder.build;
// Sign an arbitrary string, and send it somewhere dangerous.
let signed = signer.sign;
// Unsign the string and validate that it hasn't been tampered with.
let unsigned = signer.unsign.expect;
assert_eq!;