Module dryoc::sign::protected

source ·
Available on crate feature nightly only.
Expand description

§Protected memory for SigningKeyPair and SignedMessage.

§Example

use dryoc::sign::protected::*;
use dryoc::sign::SigningKeyPair;

// Generate a random keypair, using default types
let keypair = SigningKeyPair::gen_locked_keypair().expect("keypair gen failed");
let message = Message::from_slice_into_locked(
    b"Fair is foul, and foul is fair: Hover through the fog and filthy air.",
)
.expect("message lock failed");

// Sign the message, using default types (stack-allocated byte array, Vec<u8>)
let signed_message: LockedSignedMessage = keypair.sign(message).expect("signing failed");

// Verify the message signature
signed_message
    .verify(&keypair.public_key)
    .expect("verification failed");

Re-exports§

Type Aliases§

  • Heap-allocated, page-aligned signed message, for use with protected memory.
  • Heap-allocated, page-aligned public/secret keypair for message signing, for use with protected memory.
  • Heap-allocated, page-aligned message for signed messages, for use with protected memory.
  • Heap-allocated, page-aligned public-key for signed messages, for use with protected memory.
  • Heap-allocated, page-aligned secret-key for signed messages, for use with protected memory.
  • Heap-allocated, page-aligned signature for signed messages, for use with protected memory.