pub enum Algorithm {
Ed25519,
X25519,
Secp256k1,
BLS12381,
P256,
P384,
P521,
RSA,
}Expand description
Supported cryptographic algorithms.
Variants§
Implementations§
Source§impl Algorithm
impl Algorithm
Sourcepub fn muticodec_prefix(&self) -> [u8; 2]
pub fn muticodec_prefix(&self) -> [u8; 2]
Returns the multicodec prefix associated with the algorithm.
§Returns
A two-byte array representing the multicodec prefix.
Sourcepub fn from_muticodec_prefix(prefix: &[u8; 2]) -> Option<Self>
pub fn from_muticodec_prefix(prefix: &[u8; 2]) -> Option<Self>
Sourcepub fn public_key_length(&self) -> Option<usize>
pub fn public_key_length(&self) -> Option<usize>
Returns the length of the public key for the algorithm, if known.
§Returns
An Option containing the length of the public key in bytes.
Sourcepub fn uncompress_public_key(
&self,
compressed_key_bytes: &[u8],
) -> Result<Vec<u8>, CryptoError>
pub fn uncompress_public_key( &self, compressed_key_bytes: &[u8], ) -> Result<Vec<u8>, CryptoError>
Trait Implementations§
impl Copy for Algorithm
impl StructuralPartialEq for Algorithm
Auto Trait Implementations§
impl Freeze for Algorithm
impl RefUnwindSafe for Algorithm
impl Send for Algorithm
impl Sync for Algorithm
impl Unpin for Algorithm
impl UnwindSafe for Algorithm
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