[][src]Struct osshkeys::keys::PublicKey

pub struct PublicKey { /* fields omitted */ }

General public key type

This is a type to make it easy to store different types of public key in the container. Each can contain one of the types supported in this crate.

Public key is usually stored in the .pub file when generating the key.

Implementations

impl PublicKey[src]

pub fn from_keystr(keystr: &str) -> OsshResult<Self>[src]

Parse the openssh/PEM format public key file

pub fn keytype(&self) -> KeyType[src]

Indicate the key type being stored

pub fn comment(&self) -> &str[src]

Get the comment of the key

pub fn comment_mut(&mut self) -> &mut String[src]

Get the mutable reference of the key comment

pub fn serialize(&self) -> OsshResult<String>[src]

Serialize the public key as OpenSSH format

pub fn serialize_pem(&self) -> OsshResult<String>[src]

Serialize the public key as PEM format

Representation

  • Begin with -----BEGIN PUBLIC KEY----- for dsa key.
  • Begin with -----BEGIN RSA PUBLIC KEY----- for rsa key.
  • Begin with -----BEGIN PUBLIC KEY----- for ecdsa key.
  • This format doesn't support Ed25519

Note

This format cannot store the comment!

Trait Implementations

impl Display for PublicKey[src]

impl From<DsaPublicKey> for PublicKey[src]

impl From<EcDsaPublicKey> for PublicKey[src]

impl From<Ed25519PublicKey> for PublicKey[src]

impl From<RsaPublicKey> for PublicKey[src]

impl Key for PublicKey[src]

impl PublicParts for PublicKey[src]

Auto Trait Implementations

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> Same<T> for T

type Output = T

Should always be Self

impl<T> ToString for T where
    T: Display + ?Sized
[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.

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