MATTR Wallet SDK React Native / Exports / KeyManagementService
Defines the interface of the KMS interface
- close
- decrypt
- deleteKey
- deriveKey
- digest
- encrypt
- exportKey
- generateKey
- generateRandom
- getKeyInfo
- sign
- unWrapKey
- verify
- wrapKey
• Readonly
close: () => Promise
<void
>
▸ (): Promise
<void
>
Close and release resources
Promise
<void
>
Promise resolving and return nothing
• Readonly
decrypt: (decryptOptions
: EncryptionOptions
) => Promise
<Uint8Array
>
▸ (decryptOptions
): Promise
<Uint8Array
>
Takes in the necessary data to be decrypted
Name | Type |
---|---|
decryptOptions |
EncryptionOptions |
Promise
<Uint8Array
>
unencoded plaintext data
• Readonly
deleteKey: (keyId
: string
) => Promise
<undefined
| KeyInfo
>
▸ (keyId
): Promise
<undefined
| KeyInfo
>
Deletes a key by keyId
Name | Type |
---|---|
keyId |
string |
Promise
<undefined
| KeyInfo
>
a KeyInfo object of the KeyId if found
• Readonly
deriveKey: (deriveKeyOptions
: DeriveKeyOptions
) => Promise
<KeyInfo
>
▸ (deriveKeyOptions
): Promise
<KeyInfo
>
Derives a key and stores it in the KMS
Name | Type |
---|---|
deriveKeyOptions |
DeriveKeyOptions |
Promise
<KeyInfo
>
A keyInfo object of the key stored in the KMS
• Readonly
digest: (algorithm
: DigestAlgorithm
, data
: Uint8Array
) => Promise
<Uint8Array
>
▸ (algorithm
, data
): Promise
<Uint8Array
>
Generates a hash digest of the data
Name | Type |
---|---|
algorithm |
DigestAlgorithm |
data |
Uint8Array |
Promise
<Uint8Array
>
a hash digest
• Readonly
encrypt: (encryptOptions
: EncryptionOptions
) => Promise
<EncryptionResult
>
▸ (encryptOptions
): Promise
<EncryptionResult
>
Takes in the necessary data to encrypt
Name | Type |
---|---|
encryptOptions |
EncryptionOptions |
Promise
<EncryptionResult
>
unencoded ciphertext data
• Readonly
exportKey: (keyId
: string
) => Promise
<undefined
| Uint8Array
>
▸ (keyId
): Promise
<undefined
| Uint8Array
>
Name | Type |
---|---|
keyId |
string |
Promise
<undefined
| Uint8Array
>
a RAW secret, if key exists. If key isn't extractable, throws Error
• Readonly
generateKey: (generateKeyOptions
: GenerateKeyOptions
) => Promise
<KeyInfo
>
▸ (generateKeyOptions
): Promise
<KeyInfo
>
Generates a key and stores it in the KMS
Name | Type |
---|---|
generateKeyOptions |
GenerateKeyOptions |
Promise
<KeyInfo
>
a reference id to a newly generated key that's store in the KMS
• Readonly
generateRandom: (size
: number
) => Promise
<Uint8Array
>
▸ (size
): Promise
<Uint8Array
>
Generates an array of random bytes using a Cryptographically Secure Pseudo Random Number Generator (CSPRNG)
Name | Type |
---|---|
size |
number |
Promise
<Uint8Array
>
an array of pseudo random bytes
• Readonly
getKeyInfo: (keyId
: string
) => Promise
<undefined
| KeyInfo
>
▸ (keyId
): Promise
<undefined
| KeyInfo
>
Defines the parameters for getKeyInfo function interface into an object type
Name | Type | Description |
---|---|---|
keyId |
string |
The identifier of the key |
Promise
<undefined
| KeyInfo
>
a KeyInfo object of the KeyId
• Readonly
sign: (signOptions
: SignOptions
) => Promise
<Uint8Array
>
▸ (signOptions
): Promise
<Uint8Array
>
Signs a message provided as input
Name | Type |
---|---|
signOptions |
SignOptions |
Promise
<Uint8Array
>
signature of the data
• Readonly
unWrapKey: (UnWrapKeyOptions
: UnWrapKeyOptions
) => Promise
<KeyInfo
>
▸ (UnWrapKeyOptions
): Promise
<KeyInfo
>
Un-wraps a key and stores it in the KMS
Name | Type |
---|---|
UnWrapKeyOptions |
UnWrapKeyOptions |
Promise
<KeyInfo
>
Key info of the un-wrapped key
• Readonly
verify: (verifyOptions
: VerifyOptions
) => Promise
<boolean
>
▸ (verifyOptions
): Promise
<boolean
>
Verifies a signature
Name | Type |
---|---|
verifyOptions |
VerifyOptions |
Promise
<boolean
>
true if the signature is valid else false
• Readonly
wrapKey: (WrapKeyOptions
: WrapKeyOptions
) => Promise
<EncryptionResult
>
▸ (WrapKeyOptions
): Promise
<EncryptionResult
>
Wraps a key and returns it
Name | Type |
---|---|
WrapKeyOptions |
WrapKeyOptions |
Promise
<EncryptionResult
>
unencoded ciphertext data