ApgsHex

Struct ApgsHex 

Source
pub struct ApgsHex { /* private fields */ }
Expand description

ObtextCodec implementation for apgs.hex format.

Corresponds to format string: "apgs.hex"

Implementations§

Source§

impl ApgsHex

Source

pub fn new(key: &str) -> Result<Self, Error>

Create a new instance with a 86-character base64 string key.

Source

pub fn key(&self) -> String

Get the key (default base64 format)

Source§

impl ApgsHex

Source

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

Encrypt and encode plaintext

Source

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

Decode and decrypt obtext (no scheme autodetection)

Source

pub fn format(&self) -> Format

Get the format

Source

pub fn scheme(&self) -> Scheme

Get the scheme

Source

pub fn encoding(&self) -> Encoding

Get the encoding

Trait Implementations§

Source§

impl ObtextCodec for ApgsHex

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.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V