1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
//! Rust bindings to `libcryptsetup` - working with encrypted disks on Linux
//!
//! # Example
//!
//! See `api` module documentation for more.
//!
//! ```
//! use cryptsetup_rs::*;
//! # fn foo() -> Result<()> {
//! let device = open("/dev/loop0")?.luks1()?;
//! println!("Device UUID: {}", device.uuid());
//! println!("Device cipher: {}", device.cipher());
//! # Ok(())
//! # }
//! ```

#![deny(warnings)]
#[warn(unused_must_use)]
extern crate base64;
extern crate blkid_rs;
extern crate either;
extern crate errno;
extern crate libc;
extern crate libcryptsetup_sys as raw;
extern crate serde;
extern crate serde_json;
extern crate serde_repr;
extern crate serde_with;
extern crate uuid;

#[macro_use]
extern crate base64_serde;

#[macro_use]
extern crate log;

pub mod api;
pub mod device;
mod global;
mod luks1;
mod luks2;
mod luks2_meta;

#[allow(deprecated)]
pub use api::{enable_debug, format, luks1_uuid, luks_uuid, luks_version, open};
pub use api::{
    CryptDevice, CryptDeviceType, Error, Keyslot, Luks1CryptDevice, Luks1CryptDeviceHandle, Luks2CryptDevice,
    Luks2CryptDeviceHandle, Luks2Metadata, Luks2TokenHandler, Luks2TokenHandlerRaw, LuksCryptDevice, Result,
};
pub use luks2_meta::*;
pub use raw::{crypt_device_type, crypt_keyslot_info, crypt_rng_type};