MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / from_bytes

Method from_bytes

atomic-identity/src/keypair.rs:32–36  ·  view source on GitHub ↗

Create a public key from raw bytes

(bytes: &[u8; 32])

Source from the content-addressed store, hash-verified

30
31 /// Create a public key from raw bytes
32 pub fn from_bytes(bytes: &[u8; 32]) -> Result<Self, IdentityError> {
33 let key = VerifyingKey::from_bytes(bytes)
34 .map_err(|e| IdentityError::InvalidKey(e.to_string()))?;
35 Ok(PublicKey(key))
36 }
37
38 /// Get the raw bytes of the public key
39 pub fn as_bytes(&self) -> &[u8; 32] {

Callers

nothing calls this directly

Calls 2

PublicKeyClass · 0.85
SecretKeyClass · 0.85

Tested by

no test coverage detected