gcrypt 0.5.0

Libgcrypt bindings for Rust
docs.rs failed to build gcrypt-0.5.0
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build: gcrypt-0.7.0

rust-gcrypt

Build Status Build status LGPL-2.1 licensed crates.io

Libgcrypt bindings for Rust.

Documentation

Requirements

The wrapper is usable with libgcrypt 1.5.0 or later. Some features may require a more recent version.

By default, the libgcrypt-sys crate will attempt to build the latest version of the library from source using autoconf and automake. An existing installation may be specified using LIBGCRYPT_LIB, LIBGCRYPT_STATIC (optional) and LIBGCRYPT_INCLUDE_DIR. Alternatively the path to the libgcrypt configuration program (libgcrypt-config) may be specified using LIBGCRYPT_CONFIG.

Usage

Put this in your Cargo.toml:

[dependencies]
gcrypt = "0.4"

And this in your crate root:

extern crate gcrypt;

The library requires initialization before first use. The functions init and init_fips can be used to initialize the library. The closure passed to these functions is used to configure the library. More information on configuration options can be found in the libgcrypt documentation.

An example:

let token = gcrypt::init(|mut x| {
    x.disable_secmem();
});

Calling any function in the wrapper that requires initialization before init or init_fips are called will cause the wrapper to attempt to initialize the library with a default configuration.