Struct world_id::Server
[−]
[src]
pub struct Server { /* fields omitted */ }
A connection to an IPFS server that can put and request identities.
Methods
impl Server
[src]
pub fn new(hostname: &str, port: u16) -> Result<Self, Error>
[src]
pub fn default() -> Result<Self, Error>
[src]
Can't implement Default
'cause new()
returns a Result
pub fn add(&mut self, id: &Id) -> Result<String, Error>
[src]
pub fn get(&mut self, cid: &str) -> Result<Id, Error>
[src]
pub fn replace(
&mut self,
cid: &str,
new_keypair: &Keypair,
old_keypair: &Keypair
) -> Result<(Id, String), Error>
[src]
&mut self,
cid: &str,
new_keypair: &Keypair,
old_keypair: &Keypair
) -> Result<(Id, String), Error>
A wrapper around Id::new_child()
, it creates a new Id with the new keypair given, links it to the one
given by the CID (we need to find the CID for it anyway, so might as well look it up in the process),
and signs the new one wit the old one's private key.
Then shoves the new one into IPFS.
Returns the new ID and its CID.
pub fn verify_chain(&mut self, cid: &str) -> Result<bool, Error>
[src]
Takes a CID for an Id
, looks it up, and if it has a previous ID it validates that its signature
is correct, then recurses and continues looking down the chain of authority until it either fails to
validate or reaches the end of the chain.