edcert-letter

Crates.ioedcert-letter
lib.rsedcert-letter
version2.0.0
sourcesrc
created_at2016-03-20 14:09:39.59496
updated_at2016-10-22 14:25:58.790829
descriptionThis crate provides an abstraction over Edcert. You can use the Letter type to sign and verify content using Edcert Certificates.
homepage
repositoryhttps://github.com/zombiemuffin/edcert-letter/
max_upload_size
id4500
size12,473
(zombiemuffin)

documentation

https://docs.rombie.de/edcert_letter

README

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:

// You generate a ed25519 keypair
let (public_key, private_key) = ed25519::generate_keypair();

// Sign the letter with the private key
let test_str = "hello world";
let mut letter = Letter::with_private_key(test_str, &private_key);

// Now you can transport the letter and validate it using the public key.
assert_eq!(true, letter.is_valid(&public_key).is_ok());
letter.content = "world hello";
assert_eq!(false, letter.is_valid(&public_key).is_ok());

Or you can use Edcert Certificates:

// (let meta = ..., let expires = ...)
let (public_key, private_key) = ed25519::generate_keypair();
let mut cert = Certificate::generate_random(meta, expires);
cert.sign_with_master(&private_key);

let test_str = "hello world";
let mut letter = Letter::with_certificate(test_str, &cert);

assert_eq!(true, letter.is_valid(&public_key).is_ok());
letter.content = "world hello";
assert_eq!(false, letter.is_valid(&public_key).is_ok());

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

Commit count: 15

cargo fmt