Struct ic_agent::identity::Secp256k1Identity
source · pub struct Secp256k1Identity { /* private fields */ }Expand description
A cryptographic identity based on the Secp256k1 elliptic curve.
The caller will be represented via Principal::self_authenticating, which contains the SHA-224 hash of the public key.
Implementations§
source§impl Secp256k1Identity
impl Secp256k1Identity
sourcepub fn from_pem_file<P: AsRef<Path>>(file_path: P) -> Result<Self, PemError>
Available on crate feature pem only.
pub fn from_pem_file<P: AsRef<Path>>(file_path: P) -> Result<Self, PemError>
pem only.Creates an identity from a PEM file. Shorthand for calling from_pem with std::fs::read.
sourcepub fn from_pem<R: Read>(pem_reader: R) -> Result<Self, PemError>
Available on crate feature pem only.
pub fn from_pem<R: Read>(pem_reader: R) -> Result<Self, PemError>
pem only.Creates an identity from a PEM certificate.
sourcepub fn from_private_key(private_key: SecretKey) -> Self
pub fn from_private_key(private_key: SecretKey) -> Self
Creates an identity from a private key.
Trait Implementations§
source§impl Clone for Secp256k1Identity
impl Clone for Secp256k1Identity
source§fn clone(&self) -> Secp256k1Identity
fn clone(&self) -> Secp256k1Identity
Returns a copy 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 Secp256k1Identity
impl Debug for Secp256k1Identity
source§impl Identity for Secp256k1Identity
impl Identity for Secp256k1Identity
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 RefUnwindSafe for Secp256k1Identity
impl Send for Secp256k1Identity
impl Sync for Secp256k1Identity
impl Unpin for Secp256k1Identity
impl UnwindSafe for Secp256k1Identity
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