cryptsetup_rs/
lib.rs

1//! Rust bindings to `libcryptsetup` - working with encrypted disks on Linux
2//!
3//! # Example
4//!
5//! See `api` module documentation for more.
6//!
7//! ```
8//! use cryptsetup_rs::*;
9//! # fn foo() -> Result<()> {
10//! let device = open("/dev/loop0")?.luks1()?;
11//! println!("Device UUID: {}", device.uuid());
12//! println!("Device cipher: {}", device.cipher());
13//! # Ok(())
14//! # }
15//! ```
16
17#![deny(warnings)]
18#[warn(unused_must_use)]
19extern crate base64;
20extern crate blkid_rs;
21extern crate either;
22extern crate errno;
23extern crate libc;
24extern crate libcryptsetup_sys as raw;
25extern crate serde;
26extern crate serde_json;
27extern crate serde_repr;
28extern crate serde_with;
29extern crate uuid;
30
31#[macro_use]
32extern crate base64_serde;
33
34#[macro_use]
35extern crate log;
36
37pub mod api;
38pub mod device;
39mod global;
40mod luks1;
41mod luks2;
42mod luks2_meta;
43
44#[allow(deprecated)]
45pub use api::{enable_debug, format, luks1_uuid, luks_uuid, luks_version, open};
46pub use api::{
47    CryptDevice, CryptDeviceType, Error, Keyslot, Luks1CryptDevice, Luks1CryptDeviceHandle, Luks2CryptDevice,
48    Luks2CryptDeviceHandle, Luks2Metadata, Luks2TokenHandler, Luks2TokenHandlerRaw, Luks2TokenId, LuksCryptDevice,
49    Result,
50};
51pub use luks2_meta::*;
52pub use raw::{crypt_device_type, crypt_keyslot_info, crypt_rng_type};