pub struct JsMorpheusPrivate { /* private fields */ }
Expand description
Private keys of the Morpheus subtree in a vault.
@see MorpheusPlugin.priv
Implementations§
Source§impl JsMorpheusPrivate
impl JsMorpheusPrivate
Sourcepub fn public(&self) -> JsMorpheusPublic
pub fn public(&self) -> JsMorpheusPublic
Access to the public keys of the subtree. Same as {@link MorpheusPlugin.pub} would return.
Sourcepub fn bip32_path(&self) -> String
pub fn bip32_path(&self) -> String
Accessor for the BIP32 path of the Morpheus subtree.
Sourcepub fn kind(&self, did_kind: &str) -> Result<JsMorpheusPrivateKind, JsValue>
pub fn kind(&self, did_kind: &str) -> Result<JsMorpheusPrivateKind, JsValue>
There can be several usages of DIDs differentiated inside the vault invisible externally, e.g. on a blockchain. Each represents a separate subtree under the Morpheus subtree in the vault.
Use ‘persona’, ‘device’, ‘group’ or ‘resource’ in singular as a parameter.
Sourcepub fn personas(&self) -> Result<JsMorpheusPrivateKind, JsValue>
pub fn personas(&self) -> Result<JsMorpheusPrivateKind, JsValue>
Alias for {@link kind(‘persona’)}
Sourcepub fn devices(&self) -> Result<JsMorpheusPrivateKind, JsValue>
pub fn devices(&self) -> Result<JsMorpheusPrivateKind, JsValue>
Alias for {@link kind(‘device’)}
Sourcepub fn groups(&self) -> Result<JsMorpheusPrivateKind, JsValue>
pub fn groups(&self) -> Result<JsMorpheusPrivateKind, JsValue>
Alias for {@link kind(‘group’)}
Sourcepub fn resources(&self) -> Result<JsMorpheusPrivateKind, JsValue>
pub fn resources(&self) -> Result<JsMorpheusPrivateKind, JsValue>
Alias for {@link kind(‘resource’)}
Sourcepub fn key_by_pk(
&self,
pk: &JsMPublicKey,
) -> Result<JsMorpheusPrivateKey, JsValue>
pub fn key_by_pk( &self, pk: &JsMPublicKey, ) -> Result<JsMorpheusPrivateKey, JsValue>
Finds the {@link MorpheusPrivateKey} that belongs to the given multicipher {@link PublicKey}. You can check the DID kind or index of the key or get the actual {@link PrivateKey} from the returned object.
An error will be thrown if the public key has never been used yet in this vault.
Sourcepub fn key_by_id(&self, id: &JsMKeyId) -> Result<JsMorpheusPrivateKey, JsValue>
pub fn key_by_id(&self, id: &JsMKeyId) -> Result<JsMorpheusPrivateKey, JsValue>
Finds the {@link MorpheusPrivateKey} that belongs to the given multicipher {@link KeyId}. You can check the DID kind or index of the key or get the actual {@link PrivateKey} from the returned object.
An error will be thrown if the key identifier has never been used yet in this vault.
Sourcepub fn sign_did_operations(
&self,
id: &JsMKeyId,
message: &[u8],
) -> Result<JsSignedBytes, JsValue>
pub fn sign_did_operations( &self, id: &JsMKeyId, message: &[u8], ) -> Result<JsSignedBytes, JsValue>
Signs some binary payload with a private key that belongs to the given multicipher {@link KeyId}.
The returned {@link SignedBytes} has separate properties for signature and public key.
Note, that usually it is usually a bad security to let the user sign a binary content that was not reviewed by the user on a trusted user interface before serialization into that binary format.
@see keyById
Sourcepub fn sign_witness_request(
&self,
id: &JsMKeyId,
js_req: &JsValue,
) -> Result<JsSignedJson, JsValue>
pub fn sign_witness_request( &self, id: &JsMKeyId, js_req: &JsValue, ) -> Result<JsSignedJson, JsValue>
Signs a witness request for a verifiable claim with a private key that belongs to the given multicipher {@link KeyId}. An error will be thrown if the JSON does not conform to the schema of a witness request.
The returned {@link SignedJson} has separate properties for signature and public key, but can be serialized into a JSON format widely used in the IOP Stack™.
@see keyById
Sourcepub fn sign_witness_statement(
&self,
id: &JsMKeyId,
js_stmt: &JsValue,
) -> Result<JsSignedJson, JsValue>
pub fn sign_witness_statement( &self, id: &JsMKeyId, js_stmt: &JsValue, ) -> Result<JsSignedJson, JsValue>
Signs a witness statemet for a verifiable claim with a private key that belongs to the given multicipher {@link KeyId}. An error will be thrown if the JSON does not conform to the schema of a witness statement.
The returned {@link SignedJson} has separate properties for signature and public key, but can be serialized into a JSON format widely used in the IOP Stack™.
@see keyById
Sourcepub fn sign_claim_presentation(
&self,
id: &JsMKeyId,
js_presentation: &JsValue,
) -> Result<JsSignedJson, JsValue>
pub fn sign_claim_presentation( &self, id: &JsMKeyId, js_presentation: &JsValue, ) -> Result<JsSignedJson, JsValue>
Signs a claim presentation for verifiable claims with a private key that belongs to the given multicipher {@link KeyId}. An error will be thrown if the JSON does not conform to the schema of a claim presentation.
The returned {@link SignedJson} has separate properties for signature and public key, but can be serialized into a JSON format widely used in the IOP Stack™.
@see keyById
Trait Implementations§
Source§impl From<JsMorpheusPrivate> for JsValue
impl From<JsMorpheusPrivate> for JsValue
Source§fn from(value: JsMorpheusPrivate) -> Self
fn from(value: JsMorpheusPrivate) -> Self
Source§impl From<Private> for JsMorpheusPrivate
impl From<Private> for JsMorpheusPrivate
Source§impl FromWasmAbi for JsMorpheusPrivate
impl FromWasmAbi for JsMorpheusPrivate
Source§impl IntoWasmAbi for JsMorpheusPrivate
impl IntoWasmAbi for JsMorpheusPrivate
Source§impl RefFromWasmAbi for JsMorpheusPrivate
impl RefFromWasmAbi for JsMorpheusPrivate
Source§type Anchor = RcRef<JsMorpheusPrivate>
type Anchor = RcRef<JsMorpheusPrivate>
Self
for the duration of the
invocation of the function that has an &Self
parameter. This is
required to ensure that the lifetimes don’t persist beyond one function
call, and so that they remain anonymous.Source§impl TryFromJsValue for JsMorpheusPrivate
impl TryFromJsValue for JsMorpheusPrivate
Source§impl VectorFromWasmAbi for JsMorpheusPrivate
impl VectorFromWasmAbi for JsMorpheusPrivate
type Abi = <Box<[JsValue]> as FromWasmAbi>::Abi
unsafe fn vector_from_abi(js: Self::Abi) -> Box<[JsMorpheusPrivate]>
Source§impl VectorIntoJsValue for JsMorpheusPrivate
impl VectorIntoJsValue for JsMorpheusPrivate
fn vector_into_jsvalue(vector: Box<[JsMorpheusPrivate]>) -> JsValue
Source§impl VectorIntoWasmAbi for JsMorpheusPrivate
impl VectorIntoWasmAbi for JsMorpheusPrivate
type Abi = <Box<[JsValue]> as IntoWasmAbi>::Abi
fn vector_into_abi(vector: Box<[JsMorpheusPrivate]>) -> Self::Abi
Source§impl WasmDescribeVector for JsMorpheusPrivate
impl WasmDescribeVector for JsMorpheusPrivate
Source§impl Wraps<Private> for JsMorpheusPrivate
impl Wraps<Private> for JsMorpheusPrivate
impl SupportsConstructor for JsMorpheusPrivate
impl SupportsInstanceProperty for JsMorpheusPrivate
impl SupportsStaticProperty for JsMorpheusPrivate
Auto Trait Implementations§
impl Freeze for JsMorpheusPrivate
impl !RefUnwindSafe for JsMorpheusPrivate
impl !Send for JsMorpheusPrivate
impl !Sync for JsMorpheusPrivate
impl Unpin for JsMorpheusPrivate
impl !UnwindSafe for JsMorpheusPrivate
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
Source§impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
impl<T> ReturnWasmAbi for Twhere
T: IntoWasmAbi,
Source§type Abi = <T as IntoWasmAbi>::Abi
type Abi = <T as IntoWasmAbi>::Abi
IntoWasmAbi::Abi
Source§fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
fn return_abi(self) -> <T as ReturnWasmAbi>::Abi
IntoWasmAbi::into_abi
, except that it may throw and never
return in the case of Err
.