[][src]Struct kerbeiros::credentials::CredentialWarehouse

pub struct CredentialWarehouse { /* fields omitted */ }

Example

Load from ccache file:

use kerbeiros::credentials::CredentialWarehouse;
use kerberos_ccache::CCache;
use std::convert::TryFrom;
use std::fs;

let file_data = fs::read("./bob_tgt.ccache").expect("Unable to read file");

let ccache = CCache::parse(&file_data).expect("Unable to parse file content").1;
let credentials = CredentialWarehouse::try_from(ccache).expect("Unable to parse CCache");

To store several credentials related to the same user and realm

Methods

impl CredentialWarehouse[src]

pub fn credentials(&self) -> &Vec<Credential>[src]

pub fn realm(&self) -> &Realm[src]

pub fn client(&self) -> &PrincipalName[src]

impl CredentialWarehouse[src]

pub fn new(
    realm: Realm,
    client: PrincipalName,
    credentials: Vec<Credential>
) -> Self
[src]

pub fn save_into_ccache_file(&self, path: &str) -> Result<()>[src]

Saves the credentials into a file by using the ccache format, used by Linux.

pub fn save_into_krb_cred_file(&self, path: &str) -> Result<()>[src]

Saves the credentials into a file by using the KRB-CRED format, used by Windows.

Trait Implementations

impl Clone for CredentialWarehouse[src]

impl Debug for CredentialWarehouse[src]

impl From<Credential> for CredentialWarehouse[src]

impl Into<CCache> for CredentialWarehouse[src]

impl PartialEq<CredentialWarehouse> for CredentialWarehouse[src]

impl StructuralPartialEq for CredentialWarehouse[src]

impl TryFrom<CCache> for CredentialWarehouse[src]

type Error = Error

The type returned in the event of a conversion error.

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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.