ObtextCodec

Trait ObtextCodec 

Source
pub trait ObtextCodec {
    // Required methods
    fn enc(&self, plaintext: &str) -> Result<String, Error>;
    fn dec(&self, obtext: &str) -> Result<String, Error>;
    fn format(&self) -> Format;
    fn scheme(&self) -> Scheme;
    fn encoding(&self) -> Encoding;
}
Expand description

Core trait for ObtextCodec encryption+encoding/decoding+decryption implementations.

Each scheme+encoding combination (AasvC32, AasvB64, etc.) implements this trait to provide a consistent interface for encoding and decoding operations.

Note: Construction methods (new, from_bytes, new_keyless) are not part of this trait. Each type provides its own constructor with an appropriate signature.

Required Methods§

Source

fn enc(&self, plaintext: &str) -> Result<String, Error>

Encode a plaintext string.

Source

fn dec(&self, obtext: &str) -> Result<String, Error>

Decode an encoded string back to plaintext

Source

fn format(&self) -> Format

Get the full format (encapsulating scheme + encoding) used by this instance

Source

fn scheme(&self) -> Scheme

Get the scheme identifier.

Source

fn encoding(&self) -> Encoding

Get the encoding used by this instance.

Implementors§