Struct const_decoder::Pem[][src]

pub struct Pem;

Decoder for the PEM file format (Base64 with additional header / trailer lines).

Examples

// X.25519 private key generated using OpenSSL:
// `openssl genpkey -algorithm X25519`.
const PRIVATE_KEY: [u8; 48] = Pem::parse(
    b"-----BEGIN PRIVATE KEY-----
      MC4CAQAwBQYDK2VuBCIEINAOV4yAyaoM2wmJPApQs3byDhw7oJRG47V0VHwGnctD
      -----END PRIVATE KEY-----",
);

Implementations

impl Pem[src]

pub const fn parse<const N: usize>(input: &[u8]) -> [u8; N][src]

Decodes input into a byte array.

Panics

  • Panics if the provided length is insufficient or too large for input.
  • Panics if input contains invalid chars.

Trait Implementations

impl Clone for Pem[src]

impl Copy for Pem[src]

impl Debug for Pem[src]

Auto Trait Implementations

impl Send for Pem

impl Sync for Pem

impl Unpin for Pem

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.