Hi and welcome on the git page of my crate "edcert-letter".
Edcert is a simple library for certification and authentication of data.
edcert-letter provides a Letter
The design uses the "super-secure, super-fast" elliptic curve [Ed25519], which you can learn more about here
For cryptography it uses the [sodiumoxide] library, which is based on [NaCl], the well known cryptography libraray by Dan Bernstein et al.
You can use Letter with a Ed25519 Keypair directly:
```rust // You generate a ed25519 keypair let (publickey, privatekey) = ed25519::generate_keypair();
// Sign the letter with the private key let teststr = "hello world"; let mut letter = Letter::withprivatekey(teststr, &private_key);
// Now you can transport the letter and validate it using the public key. asserteq!(true, letter.isvalid(&publickey).isok()); letter.content = "world hello"; asserteq!(false, letter.isvalid(&publickey).isok()); ```
Or you can use Edcert Certificates:
```rust // (let meta = ..., let expires = ...) let (publickey, privatekey) = ed25519::generatekeypair(); let mut cert = Certificate::generaterandom(meta, expires); cert.signwithmaster(&private_key);
let teststr = "hello world"; let mut letter = Letter::withcertificate(test_str, &cert);
asserteq!(true, letter.isvalid(&publickey).isok()); letter.content = "world hello"; asserteq!(false, letter.isvalid(&publickey).isok()); ```
MIT
That means you can use this code in open source projects and/or commercial projects without any problems. Please read the license file "LICENSE" for details