pub enum SigningOptions {
Schnorr {
rng: Rc<RefCell<dyn RandomNumberGenerator>>,
},
Ssh {
namespace: String,
hash_alg: HashAlg,
},
}Expand description
Options for configuring signature creation.
Different signature schemes may require specific options:
Schnorr: Requires a random number generator for signature creationSsh: Requires a namespace and hash algorithm
Other signature types like ECDSA, Ed25519, and ML-DSA don’t require options.
§Examples
Creating Schnorr signing options:
use std::{cell::RefCell, rc::Rc};
use bc_components::SigningOptions;
use bc_rand::SecureRandomNumberGenerator;
let rng = Rc::new(RefCell::new(SecureRandomNumberGenerator));
let options = SigningOptions::Schnorr { rng };Creating SSH signing options:
use bc_components::SigningOptions;
use ssh_key::HashAlg;
let options = SigningOptions::Ssh {
namespace: "ssh".to_string(),
hash_alg: HashAlg::Sha512,
};Variants§
Schnorr
Options for Schnorr signatures
Fields
§
rng: Rc<RefCell<dyn RandomNumberGenerator>>Non-default random number generator used for signature creation
Ssh
Options for SSH signatures
Trait Implementations§
Source§impl Clone for SigningOptions
impl Clone for SigningOptions
Source§fn clone(&self) -> SigningOptions
fn clone(&self) -> SigningOptions
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for SigningOptions
impl !RefUnwindSafe for SigningOptions
impl !Send for SigningOptions
impl !Sync for SigningOptions
impl Unpin for SigningOptions
impl !UnwindSafe for SigningOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more