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.
Canister signature keys in the chain are verified against the IC mainnet root key.
Use new_with_root_key to verify against a different root key
(e.g. for a local replica or testnet).
Sourcepub fn new_with_root_key(
from_key: Vec<u8>,
to: Box<dyn Identity>,
chain: Vec<SignedDelegation>,
root_key: &[u8],
) -> Result<Self, DelegationError>
pub fn new_with_root_key( from_key: Vec<u8>, to: Box<dyn Identity>, chain: Vec<SignedDelegation>, root_key: &[u8], ) -> 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.
root_key is the DER-encoded BLS public key of the IC root (or whichever trust anchor is
appropriate for the network), required to verify canister signature keys in the chain.
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>
Source§fn sign(&self, content: &EnvelopeContent) -> Result<Signature, String>
fn sign(&self, content: &EnvelopeContent) -> Result<Signature, String>
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>
Source§fn delegation_chain(&self) -> Vec<SignedDelegation>
fn delegation_chain(&self) -> Vec<SignedDelegation>
sender
to public_key, and in that order.Source§fn sender_info(&self) -> Option<SenderInfo>
fn sender_info(&self) -> Option<SenderInfo>
None. Read more