- Preparing search index...
- The search index is not available
Webnative SDK
Type alias Implementation
Implementation
: { aes
: { decrypt
: ((encrypted
: Uint8Array, key
: CryptoKey | Uint8Array, alg
: SymmAlg, iv
?: Uint8Array) => Promise<Uint8Array>); encrypt
: ((data
: Uint8Array, key
: CryptoKey | Uint8Array, alg
: SymmAlg, iv
?: Uint8Array) => Promise<Uint8Array>); exportKey
: ((key
: CryptoKey) => Promise<Uint8Array>); genKey
: ((alg
: SymmAlg) => Promise<CryptoKey>); }; did
: { keyTypes
: Record<string, { magicBytes
: Uint8Array; verify
: ((args
: VerifyArgs) => Promise<boolean>); }>; }; hash
: { sha256
: ((bytes
: Uint8Array) => Promise<Uint8Array>); }; keystore
: { clearStore
: (() => Promise<void>); decrypt
: ((encrypted
: Uint8Array) => Promise<Uint8Array>); exportSymmKey
: ((name
: string) => Promise<Uint8Array>); getAlgorithm
: (() => Promise<string>); getUcanAlgorithm
: (() => Promise<string>); importSymmKey
: ((key
: Uint8Array, name
: string) => Promise<void>); keyExists
: ((keyName
: string) => Promise<boolean>); publicExchangeKey
: (() => Promise<Uint8Array>); publicWriteKey
: (() => Promise<Uint8Array>); sign
: ((message
: Uint8Array) => Promise<Uint8Array>); }; misc
: { randomNumbers
: ((options
: { amount
: number; }) => Uint8Array); }; rsa
: { decrypt
: ((data
: Uint8Array, privateKey
: CryptoKey | Uint8Array) => Promise<Uint8Array>); encrypt
: ((message
: Uint8Array, publicKey
: CryptoKey | Uint8Array) => Promise<Uint8Array>); exportPublicKey
: ((key
: CryptoKey) => Promise<Uint8Array>); genKey
: (() => Promise<CryptoKeyPair>); }; }
Type declaration
-
aes: {
decrypt: ((encrypted: Uint8Array, key: CryptoKey | Uint8Array, alg: SymmAlg, iv?: Uint8Array) => Promise<Uint8Array>);
encrypt: ((data: Uint8Array, key: CryptoKey | Uint8Array, alg: SymmAlg, iv?: Uint8Array) => Promise<Uint8Array>);
exportKey: ((key: CryptoKey) => Promise<Uint8Array>);
genKey: ((alg: SymmAlg) => Promise<CryptoKey>);
}
-
decrypt: ((encrypted: Uint8Array, key: CryptoKey | Uint8Array, alg: SymmAlg, iv?: Uint8Array) => Promise<Uint8Array>)
-
- (encrypted: Uint8Array, key: CryptoKey | Uint8Array, alg: SymmAlg, iv?: Uint8Array): Promise<Uint8Array>
-
Parameters
-
encrypted: Uint8Array
-
key: CryptoKey | Uint8Array
-
alg: SymmAlg
-
Optional
iv: Uint8Array
Returns Promise<Uint8Array>
-
encrypt: ((data: Uint8Array, key: CryptoKey | Uint8Array, alg: SymmAlg, iv?: Uint8Array) => Promise<Uint8Array>)
-
- (data: Uint8Array, key: CryptoKey | Uint8Array, alg: SymmAlg, iv?: Uint8Array): Promise<Uint8Array>
-
Parameters
-
data: Uint8Array
-
key: CryptoKey | Uint8Array
-
alg: SymmAlg
-
Optional
iv: Uint8Array
Returns Promise<Uint8Array>
-
exportKey: ((key: CryptoKey) => Promise<Uint8Array>)
-
- (key: CryptoKey): Promise<Uint8Array>
-
Returns Promise<Uint8Array>
-
genKey: ((alg: SymmAlg) => Promise<CryptoKey>)
-
- (alg: SymmAlg): Promise<CryptoKey>
-
Returns Promise<CryptoKey>
-
did: {
keyTypes: Record<string, {
magicBytes: Uint8Array;
verify: ((args: VerifyArgs) => Promise<boolean>);
}>;
}
-
keyTypes: Record<string, {
magicBytes: Uint8Array;
verify: ((args: VerifyArgs) => Promise<boolean>);
}>
-
hash: {
sha256: ((bytes: Uint8Array) => Promise<Uint8Array>);
}
-
sha256: ((bytes: Uint8Array) => Promise<Uint8Array>)
-
- (bytes: Uint8Array): Promise<Uint8Array>
-
Returns Promise<Uint8Array>
-
keystore: {
clearStore: (() => Promise<void>);
decrypt: ((encrypted: Uint8Array) => Promise<Uint8Array>);
exportSymmKey: ((name: string) => Promise<Uint8Array>);
getAlgorithm: (() => Promise<string>);
getUcanAlgorithm: (() => Promise<string>);
importSymmKey: ((key: Uint8Array, name: string) => Promise<void>);
keyExists: ((keyName: string) => Promise<boolean>);
publicExchangeKey: (() => Promise<Uint8Array>);
publicWriteKey: (() => Promise<Uint8Array>);
sign: ((message: Uint8Array) => Promise<Uint8Array>);
}
-
clearStore: (() => Promise<void>)
-
- (): Promise<void>
-
Returns Promise<void>
-
decrypt: ((encrypted: Uint8Array) => Promise<Uint8Array>)
-
- (encrypted: Uint8Array): Promise<Uint8Array>
-
Returns Promise<Uint8Array>
-
exportSymmKey: ((name: string) => Promise<Uint8Array>)
-
- (name: string): Promise<Uint8Array>
-
Returns Promise<Uint8Array>
-
getAlgorithm: (() => Promise<string>)
-
- (): Promise<string>
-
Returns Promise<string>
-
getUcanAlgorithm: (() => Promise<string>)
-
- (): Promise<string>
-
Returns Promise<string>
-
importSymmKey: ((key: Uint8Array, name: string) => Promise<void>)
-
- (key: Uint8Array, name: string): Promise<void>
-
Parameters
-
key: Uint8Array
-
name: string
Returns Promise<void>
-
keyExists: ((keyName: string) => Promise<boolean>)
-
- (keyName: string): Promise<boolean>
-
Returns Promise<boolean>
-
publicExchangeKey: (() => Promise<Uint8Array>)
-
- (): Promise<Uint8Array>
-
Returns Promise<Uint8Array>
-
publicWriteKey: (() => Promise<Uint8Array>)
-
- (): Promise<Uint8Array>
-
Returns Promise<Uint8Array>
-
sign: ((message: Uint8Array) => Promise<Uint8Array>)
-
- (message: Uint8Array): Promise<Uint8Array>
-
Returns Promise<Uint8Array>
-
misc: {
randomNumbers: ((options: {
amount: number;
}) => Uint8Array);
}
-
randomNumbers: ((options: {
amount: number;
}) => Uint8Array)
-
- (options: {
amount: number;
}): Uint8Array
-
Parameters
-
options: {
amount: number;
}
Returns Uint8Array
-
rsa: {
decrypt: ((data: Uint8Array, privateKey: CryptoKey | Uint8Array) => Promise<Uint8Array>);
encrypt: ((message: Uint8Array, publicKey: CryptoKey | Uint8Array) => Promise<Uint8Array>);
exportPublicKey: ((key: CryptoKey) => Promise<Uint8Array>);
genKey: (() => Promise<CryptoKeyPair>);
}
-
decrypt: ((data: Uint8Array, privateKey: CryptoKey | Uint8Array) => Promise<Uint8Array>)
-
- (data: Uint8Array, privateKey: CryptoKey | Uint8Array): Promise<Uint8Array>
-
Parameters
-
data: Uint8Array
-
privateKey: CryptoKey | Uint8Array
Returns Promise<Uint8Array>
-
encrypt: ((message: Uint8Array, publicKey: CryptoKey | Uint8Array) => Promise<Uint8Array>)
-
- (message: Uint8Array, publicKey: CryptoKey | Uint8Array): Promise<Uint8Array>
-
Parameters
-
message: Uint8Array
-
publicKey: CryptoKey | Uint8Array
Returns Promise<Uint8Array>
-
exportPublicKey: ((key: CryptoKey) => Promise<Uint8Array>)
-
- (key: CryptoKey): Promise<Uint8Array>
-
Returns Promise<Uint8Array>
-
genKey: (() => Promise<CryptoKeyPair>)
-
- (): Promise<CryptoKeyPair>
-
Returns Promise<CryptoKeyPair>
Using the key type as the record property name (ie. string = key type)
The magic bytes are the
code
found in https://github.com/multiformats/multicodec/blob/master/table.csv encoded as a variable integer (more info about that at https://github.com/multiformats/unsigned-varint).The key type is also found in that table. It's the name of the codec minus the
-pub
suffix.Example
Ed25519 public key Key type: "ed25519" Magic bytes: [ 0xed, 0x01 ]