Build Status

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 type, which can be used for simple validation of content.

How Edcert works

  1. You create a master keypair. This will be used to sign the highest certificate.
  2. You create a root certificate. Sign this with the master key.
  3. You can now create other certificates and use certificates to sign each other.
  4. Transmit your certificates in a json-encoded format over the network.
  5. Sign and verify data with the certificates using the ".sign" and ".verify" methods.

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.

How Letter works

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()); ```

License

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