pub trait BlsPublicKeyType: 'static {
type Buffer: Clone + Debug + PartialEq + Sized + Zeroize;
type BufferSize: ArrayLength<u8>;
type BufferSizeWide: ArrayLength<u8>;
const ALG_TYPE: BlsCurves;
const JWK_CURVE: &'static str;
const JWK_CURVE_OKP: &'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;
fn with_bytes_uncompressed<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 Constants§
Sourceconst JWK_CURVE_OKP: &'static str
const JWK_CURVE_OKP: &'static str
The associated JWK curve name (OKP variant)
Required Associated Types§
Sourcetype BufferSize: ArrayLength<u8>
type BufferSize: ArrayLength<u8>
The size of the serialized compressed public key
Sourcetype BufferSizeWide: ArrayLength<u8>
type BufferSizeWide: ArrayLength<u8>
The size of the serialized uncompressed public key
Required Methods§
Sourcefn from_secret_scalar(secret: &Scalar) -> Self::Buffer
fn from_secret_scalar(secret: &Scalar) -> Self::Buffer
Initialize from the secret scalar
Sourcefn from_public_bytes(key: &[u8]) -> Result<Self::Buffer, Error>
fn from_public_bytes(key: &[u8]) -> Result<Self::Buffer, Error>
Initialize from the compressed bytes
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
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.