Function mailpot_web::auth::ssh_keygen

source ·
pub async fn ssh_keygen(sig: SshSignature) -> Result<(), Box<dyn Error>>
Expand description

Run ssh signature validation with ssh-keygen binary.

use mailpot_web::{ssh_keygen, SshSignature};

async fn key_gen(
    ssh_public_key: String,
    ssh_signature: String,
) -> std::result::Result<(), Box<dyn std::error::Error>> {
    let mut sig = SshSignature {
        email: "user@example.com".to_string(),
        ssh_public_key,
        ssh_signature,
        namespace: "doc-test@example.com".into(),
        token: "d074a61990".to_string(),
    };

    ssh_keygen(sig.clone()).await?;
    Ok(())
}