Struct argonautica::Verifier[][src]

pub struct Verifier<'a> { /* fields omitted */ }

One of the two main structs. Use it to verify passwords against hashes

Methods

impl<'a> Verifier<'a>
[src]

Creates a new Verifier with the following configuration:

  • backend: Backend::C
  • cpu_pool: A CpuPool ...
    • with threads equal to the number of logical cores on your machine
    • that is lazily created, i.e. created only if / when you call the method that needs it (verify_non_blocking)
  • password_clearing: false
  • secret_key_clearing: false
  • threads: The number of logical cores on your machine

Allows you to configure Verifier with a custom backend. The default backend is Backend::C, which is currently the only backend supported. A Rust backend is planned, but is not currently available. If you configure a Verifier with Backend::Rust it will error

Allows you to configure Verifier with a custom CpuPool. The default Verifier does not have a cpu pool, which is only needed for the verify_non_blocking method. If you call verify_non_blocking without a cpu pool, a default cpu pool will be created for you on the fly; so even if you never configure Verifier with this method you can still use the verify_non_blocking method. The default cpu pool has as many threads as the number of logical cores on your machine

Allows you to configure Verifier to erase the password bytes after each call to verify or its non-blocking equivalent. The default is to not clear out the password bytes (i.e. false). If you set this option to true, you must provide Verifier with a mutable password, e.g. a password constructed from a String, Vec<u8>, &mut str, &mut [u8], etc. as opposed to one constructed from a &str, &[u8], etc., or else verifying will return an Error.

Allows you to configure Verifier to erase the secret key bytes after each call to verify or its non-blocking equivalent. The default is to not clear out the secret key bytes (i.e. false). If you set this option to true, you must provide Verifier with a mutable secret key, e.g. a secret key constructed from a String, Vec<u8>, &mut str, &mut [u8], etc. as opposed to one constructed from a &str, &[u8], etc., or else verifying will return an Error.

Allows you to configure Verifier to use a custom number of threads. The default is the number of physical cores on your machine. If you choose a number of threads that is greater than the lanes configuration of your hash, Verifier will use the minimum of the two.

Clones the Verifier, returning a new Verifier with a static lifetime. Use this method if you would like to move a Verifier to another thread

The primary method (blocking version)

After you have configured Verifier to your liking and provided it will all the data it needs to verify a password, i.e.

call this method to verify that the password matches the hash or HashRaw

The primary method (non-blocking version)

Same as verify except it returns a Future instead of a Result

Allows you to provide Verifier with the additional data that was originally used to create the hash. Normally hashes are not created with additional data; so you are not likely to need this method

Allows you to provide Verifier with the hash to verify against (in the form of a string-encoded hash like those produced by the hash or hash_non_blocking methods on Hasher)

Allows you to provide Verifier with the hash to verify against (in the form of a HashRaw like those produced by the hash_raw or hash_raw_non_blocking methods on Hasher)

Allows you to provide Verifier with the password to verify against

Allows you to provide Verifier with the secret key that was initially used to create the hash

Read-only access to the Verifier's AdditionalData, if any

Read-only access to the Verifier's VerifierConfig

Returns the Verifier's string-encoded hash, if any

Returns the Verifier's HashRaw, if any

Read-only access to the Verifier's Password, if any

Read-only access to the Verifier's SecretKey, if any

Trait Implementations

impl<'a> Default for Verifier<'a>
[src]

Same as the new method

impl<'a> Debug for Verifier<'a>
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<'a> Send for Verifier<'a>

impl<'a> Sync for Verifier<'a>