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

Method from_bytes

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

Create a public key from raw bytes

(bytes: &[u8; 32])

Source from the content-addressed store, hash-verified

24
25 /// Create a public key from raw bytes
26 pub fn from_bytes(bytes: &[u8; 32]) -> Result<Self, IdentityError> {
27 let key = VerifyingKey::from_bytes(bytes)
28 .map_err(|e| IdentityError::InvalidKey(e.to_string()))?;
29 Ok(PublicKey(key))
30 }
31
32 /// Get the raw bytes of the public key
33 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