askar_wrapper_dart library

Classes

AeadParams
A class presents a byte buffer combining the AEAD (Authenticated Encryption with Associated Data) parameters.
AskarCallbackBlankResult
Represents a blank result from an Askar callback.
AskarCallbackResult<T>
Represents a result from an Askar callback with a value.
AskarHandle
A base class for Askar handles.
AskarResult<T>
Callback<T extends Function>
Represents a callback with a specific function type.
CryptoBox
A class designed to encrypt and decrypt independent messages.
Ecdh1PU
A class for ECDH-1PU key derivation
EcdhEs
A class for ECDH-ES key derivation
EncryptedBuffer
A class presents an encrypted buffer that includes the ciphertext buffer, tag tagPos, and nonce noncePos.
Entry
A single result from a store query.
EntryList
A list of query results.
EntryListHandle
Handle for an active EntryList instance.
EntryObject
Represents an entry object in the Askar store.
Jwk
A class presents a JSON Web Key (JWK).
Key
An active key or keypair instance.
KeyEntry
Pointer to one result of a KeyEntryList instance.
KeyEntryList
A list of key query results.
KeyEntryListHandle
Handle for an active KeyEntryList instance.
KeyEntryObject
Represents a key entry object.
LocalKeyHandle
Handle for an active LocalKey instance.
OpenSession
A pending session instance.
ScanHandle
Handle for an active Store scan instance.
Session
An opened Session instance.
SessionHandle
Store
An opened Store instance.
StoreHandle
Handle for an active Store instance.

Enums

EntryOperation
Supported operations for entries in the store.
ErrorCode
Represents error codes used in the Askar SDK.
KeyAlgorithm
Represents the different key algorithms supported by Askar.
KeyBackend
Represents the types of key backends supported by Askar.
KeyMethod
Represents the key generation methods supported by Askar.
SignatureAlgorithm
Represents the different signature algorithms supported by Askar.
StoreKeyMethod
Represents the methods for deriving store keys supported by Askar.

Functions

askarBufferFree(Pointer<NativeSecretBuffer> buffer) → void
askarClearCustomLogger() → void
askarEntryListCount(EntryListHandle handle) AskarResult<int>
askarEntryListFree(EntryListHandle handle) → void
askarEntryListGetCategory(EntryListHandle handle, int index) AskarResult<String>
askarEntryListGetName(EntryListHandle handle, int index) AskarResult<String>
askarEntryListGetTags(EntryListHandle handle, int index) AskarResult<String>
askarEntryListGetValue(EntryListHandle handle, int index) AskarResult<Uint8List>
askarGetCurrentError() AskarResult<String>
askarKeyAeadDecrypt(LocalKeyHandle handle, Uint8List ciphertext, Uint8List nonce, {Uint8List? tag, Uint8List? aad}) AskarResult<Uint8List>
askarKeyAeadEncrypt(LocalKeyHandle localKeyHandle, Uint8List message, {Uint8List? nonce, Uint8List? aad}) AskarResult<EncryptedBuffer>
askarKeyAeadGetPadding(LocalKeyHandle handle, int msgLen) AskarResult<int>
askarKeyAeadGetParams(LocalKeyHandle handle) AskarResult<AeadParams>
askarKeyAeadRandomNonce(LocalKeyHandle handle) AskarResult<Uint8List>
askarKeyConvert(LocalKeyHandle handle, KeyAlgorithm alg) AskarResult<LocalKeyHandle>
askarKeyCryptoBox(LocalKeyHandle recipKey, LocalKeyHandle senderKey, Uint8List message, Uint8List nonce) AskarResult<Uint8List>
askarKeyCryptoBoxOpen(LocalKeyHandle recipKey, LocalKeyHandle senderKey, Uint8List message, Uint8List nonce) AskarResult<Uint8List>
askarKeyCryptoBoxRandomNonce() AskarResult<Uint8List>
askarKeyCryptoBoxSeal(LocalKeyHandle handle, Uint8List message) AskarResult<Uint8List>
askarKeyCryptoBoxSealOpen(LocalKeyHandle localKeyHandle, Uint8List ciphertext) AskarResult<Uint8List>
askarKeyDeriveEcdh1pu(KeyAlgorithm algorithm, LocalKeyHandle ephemeralKey, LocalKeyHandle senderKey, LocalKeyHandle recipientKey, Uint8List algId, Uint8List apu, Uint8List apv, {Uint8List? ccTag, required bool receive}) AskarResult<LocalKeyHandle>
askarKeyDeriveEcdhEs(KeyAlgorithm algorithm, LocalKeyHandle ephemeralKey, LocalKeyHandle recipientKey, Uint8List algId, Uint8List apu, Uint8List apv, bool receive) AskarResult<LocalKeyHandle>
askarKeyEntryListCount(KeyEntryListHandle handle) AskarResult<int>
askarKeyEntryListFree(KeyEntryListHandle handle) → void
askarKeyEntryListGetAlgorithm(KeyEntryListHandle handle, int index) AskarResult<String>
askarKeyEntryListGetMetadata(KeyEntryListHandle handle, int index) AskarResult<String>
askarKeyEntryListGetName(KeyEntryListHandle handle, int index) AskarResult<String>
askarKeyEntryListGetTags(KeyEntryListHandle handle, int index) AskarResult<String>
askarKeyEntryListLoadLocal(KeyEntryListHandle handle, int index) AskarResult<LocalKeyHandle>
askarKeyFree(LocalKeyHandle handle) → void
askarKeyFromJwk(String jwk) AskarResult<LocalKeyHandle>
askarKeyFromKeyExchange(KeyAlgorithm alg, LocalKeyHandle skHandle, LocalKeyHandle pkHandle) AskarResult<LocalKeyHandle>
askarKeyFromPublicBytes(KeyAlgorithm algorithm, Uint8List publicBytes) AskarResult<LocalKeyHandle>
askarKeyFromSecretBytes(KeyAlgorithm algorithm, Uint8List secret) AskarResult<LocalKeyHandle>
askarKeyFromSeed(KeyAlgorithm alg, Uint8List seed, KeyMethod method) AskarResult<LocalKeyHandle>
askarKeyGenerate(KeyAlgorithm alg, KeyBackend keyBackend, bool ephemeral) AskarResult<LocalKeyHandle>
askarKeyGetAlgorithm(LocalKeyHandle handle) AskarResult<String>
askarKeyGetEphemeral(LocalKeyHandle handle) AskarResult<bool>
askarKeyGetJwkPublic(LocalKeyHandle handle, KeyAlgorithm algorithm) AskarResult<String>
askarKeyGetJwkSecret(LocalKeyHandle handle) AskarResult<Uint8List>
askarKeyGetJwkThumbprint(LocalKeyHandle handle, KeyAlgorithm alg) AskarResult<String>
askarKeyGetPublicBytes(LocalKeyHandle handle) AskarResult<Uint8List>
askarKeyGetSecretBytes(LocalKeyHandle handle) AskarResult<Uint8List>
askarKeyGetSupportedBackends() AskarResult<StringListHandle>
askarKeySignMessage(LocalKeyHandle handle, Uint8List message, SignatureAlgorithm sigType) AskarResult<Uint8List>
askarKeyUnwrapKey(LocalKeyHandle handle, KeyAlgorithm algorithm, Uint8List ciphertext, {Uint8List? nonce, Uint8List? tag}) AskarResult<LocalKeyHandle>
askarKeyVerifySignature(LocalKeyHandle handle, Uint8List message, Uint8List signature, SignatureAlgorithm sigType) AskarResult<bool>
askarKeyWrapKey(LocalKeyHandle handle, LocalKeyHandle other, {Uint8List? nonce}) AskarResult<EncryptedBuffer>
askarMigrateIndySdk(String specUri, String walletName, String walletKey, String kdfLevel, Pointer<NativeFunction<AskarMigrateIndySdkCallback>> cb, int cbId) ErrorCode
askarScanFree(ScanHandle handle) ErrorCode
askarScanNext(ScanHandle handle) Future<AskarResult<EntryListHandle>>
askarScanStart(StoreHandle handle, {String? profile, String? category, Map? tagFilter, int? offset, int? limit}) Future<AskarResult<ScanHandle>>
askarSessionClose(SessionHandle handle, bool commit) Future<AskarCallbackBlankResult>
askarSessionCount(SessionHandle handle, String category, {Map<String, dynamic>? tagFilter}) Future<AskarResult<int>>
askarSessionFetch(SessionHandle handle, String category, String name, bool forUpdate) Future<AskarResult<EntryListHandle>>
askarSessionFetchAll(SessionHandle handle, String category, {required bool forUpdate, Map? tagFilter, int? limit}) Future<AskarResult<EntryListHandle>>
askarSessionFetchAllKeys(SessionHandle handle, {required bool forUpdate, KeyAlgorithm? algorithm, String? thumbprint, Map? tagFilter, int? limit}) Future<AskarResult<KeyEntryListHandle>>
askarSessionFetchKey(SessionHandle handle, String name, bool forUpdate) Future<AskarResult<KeyEntryListHandle>>
askarSessionInsertKey(SessionHandle handle, LocalKeyHandle localKeyHandle, String name, {String? metadata, Map<String, dynamic>? tags, int? expiryMs}) Future<AskarCallbackResult>
askarSessionRemoveAll(SessionHandle handle, String category, {Map<String, dynamic>? tagFilter}) Future<AskarCallbackResult>
askarSessionRemoveKey(SessionHandle handle, String name) Future<AskarCallbackResult>
askarSessionStart(StoreHandle handle, {required bool asTransaction, String? profile}) Future<AskarResult<SessionHandle>>
askarSessionUpdate(SessionHandle handle, EntryOperation operation, String category, String name, {String? value, Map<String, dynamic>? tags, int? expiryMs}) Future<AskarCallbackResult>
askarSessionUpdateKey(SessionHandle handle, String name, {String? metadata, Map<String, dynamic>? tags, int? expiryMs}) Future<AskarCallbackResult>
askarSetCustomLogger(Pointer<Void> context, Pointer<NativeFunction<LogCallback>> log, Pointer<NativeOptionEnabledCallbackStruct> enabled, Pointer<NativeOptionFlushCallbackStruct> flush, int maxLevel) ErrorCode
askarSetDefaultLogger() ErrorCode
askarSetMaxLogLevel(int maxLevel) ErrorCode
askarStoreClose(StoreHandle handle) Future<AskarCallbackResult>
askarStoreCopy(StoreHandle handle, String targetUri, StoreKeyMethod? keyMethod, String? passKey, bool recreate) Future<AskarResult<StoreHandle>>
askarStoreCreateProfile(StoreHandle handle, {String? profile}) Future<AskarCallbackResult>
askarStoreGenerateRawKey({Uint8List? seed}) AskarResult<String>
askarStoreGetDefaultProfile(StoreHandle handle) Future<AskarCallbackResult>
askarStoreGetProfileName(StoreHandle handle) Future<AskarResult<String>>
askarStoreListProfiles(StoreHandle handle) Future<AskarResult<StringListHandle>>
askarStoreOpen(String specUri, {StoreKeyMethod? keyMethod, String? passKey, String? profile}) Future<AskarResult<StoreHandle>>
askarStoreProvision(String specUri, {required bool recreate, StoreKeyMethod? keyMethod, String? passKey, String? profile}) Future<AskarResult<StoreHandle>>
askarStoreRekey(StoreHandle handle, String passKey, {StoreKeyMethod? keyMethod}) Future<AskarCallbackResult>
askarStoreRemove(String specUri) Future<AskarCallbackResult>
askarStoreRemoveProfile(StoreHandle handle, String profile) Future<AskarCallbackResult>
askarStoreSetDefaultProfile(StoreHandle handle, String profile) Future<AskarCallbackBlankResult>
askarStringListCount(StringListHandle handle) AskarResult<int>
askarStringListFree(StringListHandle handle) → void
askarStringListGetItem(StringListHandle handle, int index) AskarResult<String>
askarVersion() String
boolToInt(bool value) int
Converts a boolean value to an integer.
bytesListToByteBuffer(Uint8List? bytesList) Pointer<NativeByteBuffer>
Converts a list of bytes to a NativeByteBuffer.
freeByteBufferPointer(Pointer<NativeByteBuffer> byteBufferPtr) → void
freeDoublePointer(Pointer<Pointer<NativeType>> doublePointer) → void
freeEncryptedBufferPointer(Pointer<NativeEncryptedBuffer> encryptedBufferPtr) → void
freePointer(Pointer<NativeType> pointer) → void
freeSecretBufferPointer(Pointer<NativeSecretBuffer> secretBufferPtr) → void
generateRandomSeed() Uint8List
Generates a random seed.
intToBool(int value) bool
Converts an integer to a boolean value.
newCallbackWithHandle() Callback<CbFuncWithHandle>
Creates a new callback with a handle.
newCallbackWithInt64() Callback<CbFuncWithInt64>
Creates a new callback with an Int64 value.
newCallbackWithInt8() Callback<CbFuncWithInt8>
Creates a new callback with an Int8 value.
newCallbackWithoutHandle() Callback<CbFuncWithoutHandle>
Creates a new callback without a handle.
newCallbackWithPtrUtf8() Callback<CbFuncWithPtrUft8>
Creates a new callback with a UTF-8 pointer.
nextCallbackId() int
Generates the next callback ID.
readNativeAeadParams(NativeAeadParams aeadParams) AeadParams
Reads native AEAD parameters and returns an AeadParams instance.
readNativeEncryptedBuffer(NativeEncryptedBuffer encryptedBuffer) EncryptedBuffer
Reads a native encrypted buffer and converts it to an EncryptedBuffer instance.
secretBufferToBytesList(NativeSecretBuffer secretBuffer) Uint8List
Converts a NativeSecretBuffer to a list of bytes.
secretBufferToString(NativeSecretBuffer secretBuffer) String
Converts a NativeSecretBuffer to a string.
stringToByteBuffer(String value) Pointer<NativeByteBuffer>
Converts a string to a NativeByteBuffer.

Typedefs

CbFuncWithHandle = Void Function(NativeCallbackId, Int32, NativeSessionHandle)
CbFuncWithInt64 = Void Function(NativeCallbackId, Int32, Int64)
CbFuncWithInt8 = Void Function(NativeCallbackId, Int32, Int8)
CbFuncWithoutHandle = Void Function(NativeCallbackId, Int32)
CbFuncWithPtrUft8 = Void Function(NativeCallbackId, Int32, Pointer<Utf8>)
StringListHandle = int

Exceptions / Errors

AskarEntryException
Exception thrown when an entry-related error occurs.
AskarEntryListException
Exception thrown when an entry list-related error occurs.
AskarErrorCodeException
Exception thrown when an error code-related error occurs.
AskarException
Base class for all Askar exceptions.
AskarKeyEntryListException
Exception thrown when a key entry list-related error occurs.
AskarKeyException
Exception thrown when a key-related error occurs.
AskarScanException
Exception thrown when a scan-related error occurs.
AskarSessionException
Exception thrown when a session-related error occurs.
AskarStoreException
Exception thrown when a store-related error occurs.
ProfileDuplicatedException
Exception thrown when a profile is duplicated.