Trait askar_crypto::alg::bls::BlsPublicKeyType
source · pub trait BlsPublicKeyType: 'static {
type Buffer: Clone + Debug + PartialEq + Sized + Zeroize;
type BufferSize: ArrayLength<u8>;
const ALG_TYPE: BlsCurves;
const JWK_CURVE: &'static str;
// Required methods
fn from_secret_scalar(secret: &Scalar) -> Self::Buffer;
fn from_public_bytes(key: &[u8]) -> Result<Self::Buffer, Error>;
fn with_bytes<O>(
buf: &Self::Buffer,
alg: Option<KeyAlg>,
f: impl FnOnce(&[u8]) -> O
) -> O;
// Provided method
fn get_jwk_curve(_alg: Option<KeyAlg>) -> &'static str { ... }
}
Available on crate feature
bls
only.Expand description
Trait implemented by supported BLS public key types
Required Associated Types§
sourcetype BufferSize: ArrayLength<u8>
type BufferSize: ArrayLength<u8>
The size of the serialized public key
Required Associated Constants§
Required Methods§
sourcefn from_secret_scalar(secret: &Scalar) -> Self::Buffer
fn from_secret_scalar(secret: &Scalar) -> Self::Buffer
Initialize from the secret scalar
Provided Methods§
sourcefn get_jwk_curve(_alg: Option<KeyAlg>) -> &'static str
fn get_jwk_curve(_alg: Option<KeyAlg>) -> &'static str
Get the JWK curve for a specific key algorithm
Object Safety§
This trait is not object safe.