Struct world_id::Id
[−]
[src]
pub struct Id { /* fields omitted */ }
The main identity struct.
Methods
impl Id
[src]
pub fn new(id: &str, keypair: &Keypair) -> Result<Self, Error>
[src]
pub fn new_child(
&self,
self_cid: &str,
new_keypair: &Keypair,
old_keypair: &Keypair
) -> Result<Id, Error>
[src]
&self,
self_cid: &str,
new_keypair: &Keypair,
old_keypair: &Keypair
) -> Result<Id, Error>
Creates a new Id
descended from self
, with the public key from
new_keypair
and signed with the private key from old_keypair
(ie,
the one self
was created with.
pub fn to_cbor(&self) -> Result<Vec<u8>, Error>
[src]
pub fn from_cbor(c: &[u8]) -> Result<Self, Error>
[src]
pub fn verify(&self, sig: &[u8], msg: &[u8]) -> bool
[src]
Returns whether or not the given message and signature were signed with this ID's private key.
pub fn verify_child(&self, proposed_child: &Id) -> bool
[src]
Returns whether or not the given child was signed with this ID's private key.
Only verifies that one Id, not a whole chain, so
it does not check intermediate Id's.
ie, if c
descends from b
descends from a
, a.verify_child(c)
returns false.
Trait Implementations
impl Debug for Id
[src]
fn fmt(&self, __arg_0: &mut Formatter) -> Result
[src]
Formats the value using the given formatter. Read more
impl Clone for Id
[src]
fn clone(&self) -> Id
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl PartialEq for Id
[src]
fn eq(&self, __arg_0: &Id) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, __arg_0: &Id) -> bool
[src]
This method tests for !=
.