pub struct SerializableVerifyingKey(/* private fields */);Expand description
Serializable representation of a public key
This type allows Ed25519 public keys to be serialized and deserialized safely for storage or transmission.
§Example
use core_identity::{Identity, SerializableVerifyingKey};
let mut rng = rand::thread_rng();
let identity = Identity::generate(&mut rng)?;
let public_key = identity.verifying_key();
// Convert to serializable form
let serializable = SerializableVerifyingKey::from(&public_key);
// Serialize (e.g., with JSON)
let json = serde_json::to_string(&serializable)?;
// Deserialize
let deserialized: SerializableVerifyingKey = serde_json::from_str(&json)?;Implementations§
Trait Implementations§
Source§impl Clone for SerializableVerifyingKey
impl Clone for SerializableVerifyingKey
Source§fn clone(&self) -> SerializableVerifyingKey
fn clone(&self) -> SerializableVerifyingKey
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 Debug for SerializableVerifyingKey
impl Debug for SerializableVerifyingKey
Source§impl<'de> Deserialize<'de> for SerializableVerifyingKey
impl<'de> Deserialize<'de> for SerializableVerifyingKey
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl From<&VerifyingKey> for SerializableVerifyingKey
impl From<&VerifyingKey> for SerializableVerifyingKey
Source§fn from(vk: &VerifyingKey) -> Self
fn from(vk: &VerifyingKey) -> Self
Converts to this type from the input type.
Source§impl Hash for SerializableVerifyingKey
impl Hash for SerializableVerifyingKey
Source§impl PartialEq for SerializableVerifyingKey
impl PartialEq for SerializableVerifyingKey
Source§impl Serialize for SerializableVerifyingKey
impl Serialize for SerializableVerifyingKey
Source§impl TryFrom<SerializableVerifyingKey> for VerifyingKey
impl TryFrom<SerializableVerifyingKey> for VerifyingKey
Source§type Error = IdentityError
type Error = IdentityError
The type returned in the event of a conversion error.
Source§fn try_from(svk: SerializableVerifyingKey) -> Result<Self>
fn try_from(svk: SerializableVerifyingKey) -> Result<Self>
Performs the conversion.
impl Eq for SerializableVerifyingKey
impl StructuralPartialEq for SerializableVerifyingKey
Auto Trait Implementations§
impl Freeze for SerializableVerifyingKey
impl RefUnwindSafe for SerializableVerifyingKey
impl Send for SerializableVerifyingKey
impl Sync for SerializableVerifyingKey
impl Unpin for SerializableVerifyingKey
impl UnwindSafe for SerializableVerifyingKey
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