pub struct DelegatedIdentity { /* private fields */ }Expand description
An identity that has been delegated the authority to authenticate as a different principal.
Implementations§
Source§impl DelegatedIdentity
impl DelegatedIdentity
Sourcepub fn new(
from_key: Vec<u8>,
to: Box<dyn Identity>,
chain: Vec<SignedDelegation>,
) -> Result<Self, DelegationError>
pub fn new( from_key: Vec<u8>, to: Box<dyn Identity>, chain: Vec<SignedDelegation>, ) -> Result<Self, DelegationError>
Creates a delegated identity that signs using to, for the principal corresponding to the public key from_key.
chain must be a list of delegations connecting from_key to to.public_key(), and in that order;
otherwise, this function will return an error.
Sourcepub fn new_unchecked(
from_key: Vec<u8>,
to: Box<dyn Identity>,
chain: Vec<SignedDelegation>,
) -> Self
pub fn new_unchecked( from_key: Vec<u8>, to: Box<dyn Identity>, chain: Vec<SignedDelegation>, ) -> Self
Creates a delegated identity that signs using to, for the principal corresponding to the public key from_key.
chain must be a list of delegations connecting from_key to to.public_key(), and in that order;
otherwise, the replica will reject this delegation when used as an identity.
Trait Implementations§
Source§impl Identity for DelegatedIdentity
impl Identity for DelegatedIdentity
Source§fn sender(&self) -> Result<Principal, String>
fn sender(&self) -> Result<Principal, String>
Returns a sender, ie. the Principal ID that is used to sign a request. Read more
Source§fn sign(&self, content: &EnvelopeContent) -> Result<Signature, String>
fn sign(&self, content: &EnvelopeContent) -> Result<Signature, String>
Sign a request ID derived from a content map. Read more
Source§fn sign_delegation(&self, content: &Delegation) -> Result<Signature, String>
fn sign_delegation(&self, content: &Delegation) -> Result<Signature, String>
Source§fn sign_arbitrary(&self, content: &[u8]) -> Result<Signature, String>
fn sign_arbitrary(&self, content: &[u8]) -> Result<Signature, String>
Sign arbitrary bytes. Read more
Source§fn delegation_chain(&self) -> Vec<SignedDelegation>
fn delegation_chain(&self) -> Vec<SignedDelegation>
A list of signed delegations connecting
sender
to public_key, and in that order.Auto Trait Implementations§
impl Freeze for DelegatedIdentity
impl !RefUnwindSafe for DelegatedIdentity
impl Send for DelegatedIdentity
impl Sync for DelegatedIdentity
impl Unpin for DelegatedIdentity
impl !UnwindSafe for DelegatedIdentity
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