Skip to main content

Crate mini_sign

Crate mini_sign 

Source
Expand description

CI status Last version Documentation

§minisign-rs

A Rust implementation lib of the Minisign.

Low-level library for the minisign system, designed to be used in CI/CD pipelines, or embedded into other processes (rather than manual command line).

§!!! This library not support legacy signature format !!!

§Example

use mini_sign::{
    KeyPairBox,
    sign,
    verify,
};
let KeyPairBox {
    public_key_box,
    secret_key_box,
} = KeyPairBox::generate(
    Some(b"password"),
    Some("pk untrusted comment"),
    Some("sk untrusted comment"),
)
.unwrap();
let msg = "test";
let sig_box = sign(
    Some(&public_key_box),
    &secret_key_box,
    Some(b"password"),
    msg.as_bytes(),
    Some("trusted comment"),
    Some("untrusted comment"),
)
.unwrap();
let v = verify(&public_key_box, &sig_box, msg.as_bytes()).unwrap();
assert_eq!(v, true);

Structs§

KeyPairBox
A KeyPairBox represents a minisign key pair.
PublicKeyBox
A PublicKeyBox represents a minisign public key.
SError
Error type for minisign-rs
SecretKeyBox
A SecretKeyBox represents a minisign secret key.
SignatureBox
A SignatureBox represents a minisign signature.

Enums§

ErrorKind
Error kind for minisign-rs

Functions§

pub_key_from_sec_key
Create a new public key from a secret key
pub_key_from_str
Create a new public key from a string in the minisign format pub key file
sec_key_from_str
Create a new secret key from a string in the minisign format key file
sign
minisign some data
verify
Verify a minisign signature

Type Aliases§

Result