Skip to main content

KeysClient

Struct KeysClient 

Source
pub struct KeysClient { /* private fields */ }
Expand description

Client for keys operations.

Implementations§

Source§

impl KeysClient

Source

pub fn new(client: Client) -> Self

Source

pub async fn list_keys( &self, query: Option<ListKeysQuery>, ) -> Result<ListKeysResponse, Error>

Retrieve all keys registered for your organization.

Source

pub async fn create_key( &self, body: CreateKeyRequest, ) -> Result<CreateKeyResponse, Error>

Creates a key for the given scheme and curve. Returns the new key entity.

Source

pub async fn delegate_key( &self, key_id: String, body: DelegateKeyRequest, ) -> Result<DelegateKeyResponse, Error>

Only keys created with "`delayDelegation: true`" can then be delegated to an end-user. It means you need to know ahead of time that you're creating a wallet meant to be delegated to an end-user later. This is a safety to prevent, for example, a treasury wallet from being unintentionally delegated to an end-user.
Source

pub async fn get_key(&self, key_id: String) -> Result<GetKeyResponse, Error>

Retrieves a key information by its ID.

Source

pub async fn update_key( &self, key_id: String, body: UpdateKeyRequest, ) -> Result<UpdateKeyResponse, Error>

Updates the name of an existing key.

Source

pub async fn delete_key( &self, key_id: String, ) -> Result<DeleteKeyResponse, Error>

Deletes the key and all wallets using this key. Once deleted, keys (and wallets) are not usable anymore, and won’t count in your overall organisation wallet count.

Source

pub async fn derive_key( &self, key_id: String, body: DeriveKeyRequest, ) -> Result<DeriveKeyResponse, Error>

Dfns decentralized key management network supports threshold Diffie-Hellman protocol based on GLOW20 paper. You can use the DH protocol to derive output from a domain separation tag and a seed value. The derivation process is deterministic, i.e. the same Diffie-Hellman key and seed will lead to the same derived output. To ensure reproducibility, we use hash to curve RFC9380 and standard ciphersuite secp256k1_XMD:SHA-256_SSWU_RO_.

The seed doesn’t need to be secret. Without access to the DH key, it is not possible to do the derivation, even if the seed is known. Moreover, if both seed and derived output are known, it’s also not possible to do the derivation for another seed without having access to the DH key.
Source

pub async fn export_key( &self, key_id: String, body: ExportKeyRequest, ) -> Result<ExportKeyResponse, Error>

Dfns secures private keys by generating them as MPC key shares in our decentralized key management network. Our goal is to eliminate all single points of failure (SPOFs) associated with blockchain private keys.

In certain circumstances, however, customers require Dfns to export a private key. In this case, Dfns exposes the following endpoint which can be used in conjunction with our export SDK. Each signer returns its key share encrypted to an encryption key you provide; the full private key is reconstituted client-side and is never assembled on Dfns servers.

Source

pub async fn list_signatures( &self, key_id: String, query: Option<ListSignaturesQuery>, ) -> Result<ListSignaturesResponse, Error>

List all signature requests for a key.

Source

pub async fn generate_signature( &self, key_id: String, body: GenerateSignatureRequest, ) -> Result<GenerateSignatureResponse, Error>

Request to generate a signature with the key. This process does not broadcast anything on-chain, this is just an off-chain signature request.

Dfns is compatible with any blockchain that uses a supported key format. If Dfns doesn’t officially integrate with a blockchain, you can use hash signing to generate the signatures to interact with the chain.

Source

pub async fn get_signature( &self, key_id: String, signature_id: String, ) -> Result<GetSignatureResponse, Error>

Retrieve a signature request details.

Source

pub async fn import_key( &self, body: ImportKeyRequest, ) -> Result<ImportKeyResponse, Error>

Dfns secures private keys by generating them as MPC key shares in our decentralized key management network. This happens by default when you create a key or wallet.

In some circumstances, however, you may need to import an existing private key into Dfns infrastructure, instead of creating a brand new wallet with Dfns and transfer funds to it. As an example, you might want to keep an existing wallet if its address is tied to a smart contract which you don’t want to re-deploy.

Trait Implementations§

Source§

impl Clone for KeysClient

Source§

fn clone(&self) -> KeysClient

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more