Skip to main content

Commands

Enum Commands 

Source
pub enum Commands {
    Keygen {
        ikm: Option<String>,
        out: Option<String>,
    },
    Pubkey {
        path: Option<String>,
    },
    Sign {
        path: Option<String>,
        msg: String,
    },
    Verify {
        pk: String,
        msg: String,
        sig: String,
    },
}
Expand description

Available commands for the BLS signature CLI.

Variants§

§

Keygen

Generate a new BLS secret key.

This command allows you to derive a new secret key from Input Key Material (IKM) or generate a random one if no IKM is provided. The generated key can be printed to standard output or saved to a specified file.

Fields

§ikm: Option<String>

Optional: Input Key Material (IKM) used to derive the BLS private key. This should be a high-entropy, secret string. If not provided, a cryptographically secure random private key will be generated.

§out: Option<String>

Optional: Specifies the file path where the generated secret key should be stored. If this argument is omitted, the secret key will be printed to standard output.

§

Pubkey

Derive and print the public key associated with a given BLS secret key file.

This command reads a secret key from a specified file and computes its corresponding public key, which is then printed to standard output.

Fields

§path: Option<String>

Optional: Path to the BLS secret key file. If omitted, the application might look for a default key file (e.g., in a standard configuration directory), or it may result in an error if no key can be found.

§

Sign

Sign a message using a BLS secret key.

This command takes a message and a secret key (from a file) to produce a BLS signature. The signature will be printed to standard output.

Fields

§path: Option<String>

Optional: Path to the BLS secret key file to be used for signing. If omitted, the application might look for a default key file (e.g., in a standard configuration directory), or it may result in an error if no key can be found.

§msg: String

Mandatory: The message data to be signed. This can be a raw string provided directly on the command line, or the content of a file (if your application’s logic supports reading from file).

§

Verify

Verify a BLS signature against a public key and a message.

This command takes a public key, a message, and a signature (all in hexadecimal format) and verifies if the signature is valid for the given message and public key. The verification result (success or failure) will be printed.

Fields

§pk: String

Mandatory: The BLS public key, provided in hexadecimal string format.

§msg: String

Mandatory: The original message that was signed. This can be a raw string provided directly on the command line, or the content of a file (if your application’s logic supports reading from file). It must exactly match the message used during signing.

§sig: String

Mandatory: The BLS signature, provided in hexadecimal string format.

Trait Implementations§

Source§

impl Debug for Commands

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl FromArgMatches for Commands

Source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches, ) -> Result<Self, Error>

Instantiate Self from ArgMatches, parsing the arguments as needed. Read more
Source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

fn update_from_arg_matches_mut<'b>( &mut self, __clap_arg_matches: &mut ArgMatches, ) -> Result<(), Error>

Assign values from ArgMatches to self.
Source§

impl Subcommand for Commands

Source§

fn augment_subcommands<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate Self via FromArgMatches::from_arg_matches_mut Read more
Source§

fn augment_subcommands_for_update<'b>(__clap_app: Command) -> Command

Append to Command so it can instantiate self via FromArgMatches::update_from_arg_matches_mut Read more
Source§

fn has_subcommand(__clap_name: &str) -> bool

Test whether Self can parse a specific subcommand

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V