pub struct BlsKeyPair<Pk: BlsPublicKeyType> { /* private fields */ }Available on crate feature
bls only.Expand description
A BLS12-381 key pair
Implementations§
Source§impl<Pk: BlsPublicKeyType> BlsKeyPair<Pk>
impl<Pk: BlsPublicKeyType> BlsKeyPair<Pk>
Sourcepub fn from_seed(seed: &[u8]) -> Result<Self, Error>
pub fn from_seed(seed: &[u8]) -> Result<Self, Error>
Generate a new BLS key from a seed according to the KeyGen algorithm
Sourcepub fn bls_public_key(&self) -> &Pk::Buffer
pub fn bls_public_key(&self) -> &Pk::Buffer
Accessor for the associated public key
Sourcepub fn bls_secret_scalar(&self) -> Option<&Scalar>
pub fn bls_secret_scalar(&self) -> Option<&Scalar>
Accessor for the associated secret key value, if any
Trait Implementations§
Source§impl<Pk: Clone + BlsPublicKeyType> Clone for BlsKeyPair<Pk>
impl<Pk: Clone + BlsPublicKeyType> Clone for BlsKeyPair<Pk>
Source§fn clone(&self) -> BlsKeyPair<Pk>
fn clone(&self) -> BlsKeyPair<Pk>
Returns a duplicate 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 moreSource§impl<Pk: BlsPublicKeyType> Debug for BlsKeyPair<Pk>
impl<Pk: BlsPublicKeyType> Debug for BlsKeyPair<Pk>
Source§impl From<&BlsKeyPair<G1G2>> for BlsKeyPair<G1>
impl From<&BlsKeyPair<G1G2>> for BlsKeyPair<G1>
Source§fn from(kp: &BlsKeyPair<G1G2>) -> Self
fn from(kp: &BlsKeyPair<G1G2>) -> Self
Converts to this type from the input type.
Source§impl From<&BlsKeyPair<G1G2>> for BlsKeyPair<G2>
impl From<&BlsKeyPair<G1G2>> for BlsKeyPair<G2>
Source§fn from(kp: &BlsKeyPair<G1G2>) -> Self
fn from(kp: &BlsKeyPair<G1G2>) -> Self
Converts to this type from the input type.
Source§impl<Pk: BlsPublicKeyType> FromJwk for BlsKeyPair<Pk>
impl<Pk: BlsPublicKeyType> FromJwk for BlsKeyPair<Pk>
Source§impl<Pk: BlsPublicKeyType> HasKeyAlg for BlsKeyPair<Pk>
impl<Pk: BlsPublicKeyType> HasKeyAlg for BlsKeyPair<Pk>
Source§impl<Pk: BlsPublicKeyType> HasKeyBackend for BlsKeyPair<Pk>
impl<Pk: BlsPublicKeyType> HasKeyBackend for BlsKeyPair<Pk>
Source§fn key_backend(&self) -> KeyBackend
fn key_backend(&self) -> KeyBackend
Get the corresponding key backend.
Source§impl<Pk: BlsPublicKeyType> KeyGen for BlsKeyPair<Pk>
impl<Pk: BlsPublicKeyType> KeyGen for BlsKeyPair<Pk>
Source§impl<Pk: BlsPublicKeyType> KeyMeta for BlsKeyPair<Pk>
impl<Pk: BlsPublicKeyType> KeyMeta for BlsKeyPair<Pk>
Source§impl<Pk: BlsPublicKeyType> KeyPublicBytes for BlsKeyPair<Pk>where
Self: KeypairMeta,
impl<Pk: BlsPublicKeyType> KeyPublicBytes for BlsKeyPair<Pk>where
Self: KeypairMeta,
Source§impl<Pk: BlsPublicKeyType> KeySecretBytes for BlsKeyPair<Pk>
impl<Pk: BlsPublicKeyType> KeySecretBytes for BlsKeyPair<Pk>
Source§impl<Pk> KeypairMeta for BlsKeyPair<Pk>where
Pk: BlsPublicKeyType,
U32: Add<Pk::BufferSize>,
<U32 as Add<Pk::BufferSize>>::Output: ArrayLength<u8>,
impl<Pk> KeypairMeta for BlsKeyPair<Pk>where
Pk: BlsPublicKeyType,
U32: Add<Pk::BufferSize>,
<U32 as Add<Pk::BufferSize>>::Output: ArrayLength<u8>,
Source§type PublicKeySize = <Pk as BlsPublicKeyType>::BufferSize
type PublicKeySize = <Pk as BlsPublicKeyType>::BufferSize
The size of the key public bytes
Source§type KeypairSize = <<BlsKeyPair<Pk> as KeyMeta>::KeySize as Add<<Pk as BlsPublicKeyType>::BufferSize>>::Output
type KeypairSize = <<BlsKeyPair<Pk> as KeyMeta>::KeySize as Add<<Pk as BlsPublicKeyType>::BufferSize>>::Output
The size of the secret bytes and public bytes combined
Source§impl<Pk: BlsPublicKeyType> PartialEq for BlsKeyPair<Pk>
impl<Pk: BlsPublicKeyType> PartialEq for BlsKeyPair<Pk>
Source§impl<Pk: BlsPublicKeyType> ToJwk for BlsKeyPair<Pk>
impl<Pk: BlsPublicKeyType> ToJwk for BlsKeyPair<Pk>
Source§fn encode_jwk(&self, enc: &mut dyn JwkEncoder) -> Result<(), Error>
fn encode_jwk(&self, enc: &mut dyn JwkEncoder) -> Result<(), Error>
Write the JWK representation to an encoder
Source§fn to_jwk_thumbprint(&self, alg: Option<KeyAlg>) -> Result<String, Error>
fn to_jwk_thumbprint(&self, alg: Option<KeyAlg>) -> Result<String, Error>
Available on crate feature
alloc only.Create the JWK thumbprint of the key
Source§fn to_jwk_public(&self, alg: Option<KeyAlg>) -> Result<String, Error>
fn to_jwk_public(&self, alg: Option<KeyAlg>) -> Result<String, Error>
Available on crate feature
alloc only.Create a JWK of the public key
Source§fn to_jwk_secret(&self, alg: Option<KeyAlg>) -> Result<SecretBytes, Error>
fn to_jwk_secret(&self, alg: Option<KeyAlg>) -> Result<SecretBytes, Error>
Available on crate feature
alloc only.Create a JWK of the secret key
Source§impl<Pk: BlsPublicKeyType> Zeroize for BlsKeyPair<Pk>
impl<Pk: BlsPublicKeyType> Zeroize for BlsKeyPair<Pk>
impl<Pk: BlsPublicKeyType> Eq for BlsKeyPair<Pk>
Auto Trait Implementations§
impl<Pk> Freeze for BlsKeyPair<Pk>
impl<Pk> RefUnwindSafe for BlsKeyPair<Pk>
impl<Pk> Send for BlsKeyPair<Pk>
impl<Pk> Sync for BlsKeyPair<Pk>
impl<Pk> Unpin for BlsKeyPair<Pk>
impl<Pk> UnwindSafe for BlsKeyPair<Pk>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<K> ToPublicBytes for Kwhere
K: KeyPublicBytes,
impl<K> ToPublicBytes for Kwhere
K: KeyPublicBytes,
Source§fn write_public_bytes(&self, out: &mut dyn WriteBuffer) -> Result<(), Error>
fn write_public_bytes(&self, out: &mut dyn WriteBuffer) -> Result<(), Error>
Write the key public bytes to a buffer.
Source§fn to_public_bytes(&self) -> Result<SecretBytes, Error>
fn to_public_bytes(&self) -> Result<SecretBytes, Error>
Available on crate feature
alloc only.Write the key public bytes to a new allocated buffer.
Source§impl<K> ToSecretBytes for Kwhere
K: KeySecretBytes,
impl<K> ToSecretBytes for Kwhere
K: KeySecretBytes,
Source§fn write_secret_bytes(&self, out: &mut dyn WriteBuffer) -> Result<(), Error>
fn write_secret_bytes(&self, out: &mut dyn WriteBuffer) -> Result<(), Error>
Write the key secret bytes to a buffer.
Source§fn to_secret_bytes(&self) -> Result<SecretBytes, Error>
fn to_secret_bytes(&self) -> Result<SecretBytes, Error>
Available on crate feature
alloc only.Write the key secret bytes to a new allocated buffer.