Enum fcp_cryptoauth::authentication::Credentials
[−]
[src]
pub enum Credentials { LoginPassword { login: Vec<u8>, password: Vec<u8>, }, Password { password: Vec<u8>, }, None, }
Used for specifying authorization credentials of a peer, either oneself or an incoming peer.
Represents an authorization method and its data, as defined by https://github.com/fc00/spec/blob/10b349ab11/cryptoauth.md#authorization-challenges
Variants
LoginPassword
This is the preferred credentials method, with a login and a password.
The login is used to tell the other party who we are, and the password is combined with cryptographic keys of the two peers to computed a shared secret, in order to provide a stronger authentication than just checking public keys.
The password is not revealed to someone who does not know it, even if they have the secret keys of both peers.
Fields of LoginPassword
login: Vec<u8> | The login used to tell who we are. Does not have to be a secret, but must be unique. Seven bytes of its sha256 hash are sent unencrypted before authentication. |
password: Vec<u8> | The password which will be combined with keys of other peers to prove who we are. |
Password
Password-only credentials. This method is not recommended and may be dropped in the future. See https://github.com/cjdelisle/cjdns/blob/cjdns-v18/util/version/Version.h#L357-L363 for details about why the LoginPassword method is prefered.
Fields of Password
password: Vec<u8> | The password used to tell who we are and prove it. It must be unique. Seven bytes of its double-sha256 hash are sent unencrypted before authentication. |
None
Pseudo-credentials used for when authorization is not needed. Do not use it for outgoing connections.
Trait Implementations
impl Clone for Credentials
[src]
fn clone(&self) -> Credentials
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more
impl Debug for Credentials
[src]
impl Hash for Credentials
[src]
fn hash<__H: Hasher>(&self, __arg_0: &mut __H)
Feeds this value into the given [Hasher
]. Read more
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl Eq for Credentials
[src]
impl PartialEq for Credentials
[src]
fn eq(&self, __arg_0: &Credentials) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Credentials) -> bool
This method tests for !=
.
impl ToAuthChallenge for Credentials
[src]
fn to_auth_challenge_bytes(&self, _session: &Session) -> [u8; 12]
Generates a byte array representation of the auth challenge, as defined by: https://github.com/cjdelisle/cjdns/blob/cjdns-v17.4/doc/Whitepaper.md#authentication-field