pub struct CanisterMasterKey { /* private fields */ }Expand description
The canister’s master public key of a threshold signature system
Each canister gets its own canister master key, which is derived from the system master key.
Implementations§
Source§impl CanisterMasterKey
impl CanisterMasterKey
Sourcepub fn derive_key_with_context(&self, context: &[u8]) -> DerivedPublicKey
pub fn derive_key_with_context(&self, context: &[u8]) -> DerivedPublicKey
Derive the public key from a canister key and a single contextual input
VetKeys requires exactly one contextual input be supplied. In addition, if that contextual input is the empty bytestring then the “derived key” is identical to the canister master public key. This matches the behavior of the management canister interface.
For other keys, which support a path of inputs, this is equivalent to deriving using a path of length 1
Sourcepub fn derive_key(&self, path: &[Vec<u8>]) -> Result<DerivedPublicKey, Error>
pub fn derive_key(&self, path: &[Vec<u8>]) -> Result<DerivedPublicKey, Error>
Derive a public key using a path of contextual inputs
Note that VetKD does not support derivation paths, but only a single context string, so VetKD is not supported by this function.
Sourcepub fn serialize(&self) -> Vec<u8> ⓘ
pub fn serialize(&self) -> Vec<u8> ⓘ
Return the serialized encoding of the canister master public key
Sourcepub fn chain_code(&self) -> Option<Vec<u8>>
pub fn chain_code(&self) -> Option<Vec<u8>>
Return the chain code used for further derivation, if relevant
Returns None if not applicable for this algorithm