Struct cold_iron::crypt::ThaumCrypto [−]
pub struct ThaumCrypto { /* fields omitted */ }
Expand description
ThaumCrypto is a wrapper struct, representing a SITA or other Thaumatic device ready to perform thaumocryptography
Implementations
impl ThaumCrypto
impl ThaumCrypto
pub fn create(thaum: impl Thaumatic) -> Result<ThaumCrypto, ThaumError>
pub fn create(thaum: impl Thaumatic) -> Result<ThaumCrypto, ThaumError>
Prepare a thaumatic device for cryptography
pub fn encrypt<T>(&mut self, msg: Message<T>) -> Result<Envelope<T>, ThaumError>
pub fn encrypt<T>(&mut self, msg: Message<T>) -> Result<Envelope<T>, ThaumError>
Attempt to encrypt a given message The destination is not specified in code, using instead the intent of the caster.
Attempt to encrypt a given message for a certain author. Standard disclaimers about true names apply for string-encoded recipients.
pub fn decrypt<T>(
&mut self,
envelope: Envelope<T>
) -> Result<Message<T>, ThaumError>
pub fn decrypt<T>(
&mut self,
envelope: Envelope<T>
) -> Result<Message<T>, ThaumError>
Attempt to decrypt an envelope. The author is not specified in code, using instead the intent of the caster.
Attempt to decrypt an envelope. Standard disclaimers about true names apply for string-encoded authors.
pub fn verify<T>(&mut self, msg: Message<T>) -> Result<bool, ThaumError>
pub fn verify<T>(&mut self, msg: Message<T>) -> Result<bool, ThaumError>
Verify the authenticity of a signed, unencrypted message. The author is not specified in code, using instead the intent of the caster.
Verify the authenticity of a signed, unencrypted message. Standard disclaimers about true names apply for string-encoded authors.