| 1 | # linux-keyutils |
| 2 | [![cargo-badge-lib][]][cargo-lib] [![docs-badge-lib][]][docs-lib] [![license-badge][]][license] [![rust-version-badge][]][rust-version] [![build][]][build-url] [![codecov][]][codecov-url] |
| 3 | |
| 4 | Rust interface to the Linux key-management facility. Provides a safe interface around the raw system calls allowing user-space programs to perform key manipulation. |
| 5 | |
| 6 | There is a good [cloudflare blog](https://blog.cloudflare.com/the-linux-kernel-key-retention-service-and-why-you-should-use-it-in-your-next-application/) discussing why it should be used. |
| 7 | |
| 8 | ## Basic Usage |
| 9 | |
| 10 | To use `linux-keyutils`, first add this to your `Cargo.toml`: |
| 11 | |
| 12 | ```toml |
| 13 | [dependencies] |
| 14 | linux-keyutils = "0.2" |
| 15 | ``` |
| 16 | |
| 17 | For more information please view the full [documentation](https://docs.rs/linux-keyutils). There is also a small example program in the [examples directory](examples/keyctl.rs). |
| 18 | |
| 19 | ## Features |
| 20 | |
| 21 | * `#![no_std]` by default. |
| 22 | * For std programs `KeyError` implements `std::error::Error` when the `std` feature of this crate enabled. |
| 23 | * Small footprint, the library only relies on the `libc` and `bitflags` crates. |
| 24 | |
| 25 | ## License |
| 26 | |
| 27 | Licensed under either of the following at your discretion: |
| 28 | |
| 29 | * Apache License, Version 2.0 ([LICENSE-APACHE](LICENSE-APACHE) or http://www.apache.org/licenses/LICENSE-2.0) |
| 30 | * MIT license ([LICENSE-MIT](LICENSE-MIT) or http://opensource.org/licenses/MIT) |
| 31 | |
| 32 | ### Contribution |
| 33 | |
| 34 | Unless you explicitly state otherwise, any contribution intentionally submitted |
| 35 | for inclusion in the work by you shall be dual licensed as above, without any |
| 36 | additional terms or conditions. |
| 37 | |
| 38 | [//]: # (badges) |
| 39 | [license-badge]: https://img.shields.io/badge/license-MIT/Apache--2.0-lightgray.svg?style=flat-square |
| 40 | [license]: #license |
| 41 | [rust-version-badge]: https://img.shields.io/badge/rust-latest%20stable-blue.svg?style=flat-square |
| 42 | [rust-version]: #rust-version-policy |
| 43 | [cargo-badge-lib]: https://img.shields.io/crates/v/linux-keyutils.svg?style=flat-square&label=linux-keyutils |
| 44 | [cargo-lib]: https://crates.io/crates/linux-keyutils |
| 45 | [docs-badge-lib]: https://img.shields.io/docsrs/linux-keyutils/latest?style=flat-square |
| 46 | [docs-lib]: https://docs.rs/linux-keyutils |
| 47 | [codecov]: https://img.shields.io/codecov/c/github/landhb/linux-keyutils?style=flat-square |
| 48 | [codecov-url]: https://codecov.io/gh/landhb/linux-keyutils |
| 49 | [build]: https://img.shields.io/github/actions/workflow/status/landhb/linux-keyutils/checks.yml?branch=main&style=flat-square |
| 50 | [build-url]: https://github.com/landhb/linux-keyutils/actions?query=workflow%3Achecks |