yubihsm 0.26.0

Pure Rust client for YubiHSM2 devices with support for HTTP and USB-based access to the device. Supports most HSM functionality including ECDSA, Ed25519, HMAC, and RSA.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
//! UUID functionality

use getrandom::getrandom;
pub use uuid::Uuid;
use uuid::{Builder, Variant, Version};

/// Create a random UUID
pub fn new_v4() -> Uuid {
    let mut bytes = [0; 16];
    getrandom(&mut bytes).expect("RNG failure!");

    Builder::from_bytes(bytes)
        .set_variant(Variant::RFC4122)
        .set_version(Version::Random)
        .build()
}