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
//! Put an existing auth key into the `YubiHSM 2`
//!
//! <https://developers.yubico.com/YubiHSM2/Commands/Put_Authentication_Key.html>

use crate::{
    authentication,
    capability::Capability,
    command::{self, Command},
    object,
    response::Response,
};
use serde::{Deserialize, Serialize};

/// Request parameters for `command::put_authentication_key`
#[derive(Serialize, Deserialize, Debug)]
pub(crate) struct PutAuthenticationKeyCommand {
    /// Common parameters to all put object command
    pub params: object::import::Params,

    /// Delegated capabilities
    pub delegated_capabilities: Capability,

    /// Authentication key
    pub authentication_key: authentication::Key,
}

impl Command for PutAuthenticationKeyCommand {
    type ResponseType = PutAuthenticationKeyResponse;
}

/// Response from `command::put_authentication_key`
#[derive(Serialize, Deserialize, Debug)]
pub(crate) struct PutAuthenticationKeyResponse {
    /// ID of the key
    pub key_id: object::Id,
}

impl Response for PutAuthenticationKeyResponse {
    const COMMAND_CODE: command::Code = command::Code::PutAuthenticationKey;
}