Skip to main content

revault_api 0.6.2 copy "revault_api: ^0.6.2" to clipboard
revault_api: ^0.6.2 copied to clipboard

Typed Dart FFI bindings for encrypted reVault lockboxes, credentials, keys, form records, and local vault metadata on Android, Linux, macOS, and Windows.

example/revault_api_example.dart

import 'dart:typed_data';

import 'package:revault_api/revault_api.dart';

/// Creates an in-memory lockbox and stores public and secret values in it.
Future<void> main() async {
  await Revault.load();
  final contentKey = SecretBytes.random(32);
  final lockbox = Lockbox.createInMemory(contentKey: contentKey);

  try {
    lockbox.addFile(
      '/hello.txt',
      Uint8List.fromList('hello\n'.codeUnits),
      replace: false,
    );
    lockbox.setVariable('owner', 'alice');
    final token = SecretBytes.fromString('secret');
    try {
      lockbox.setSecretVariable('token', token);
    } finally {
      token.close();
    }
    final tokenLength = lockbox.withSecretVariable(
      'token',
      (token) => token.length,
    );
    print('Stored a $tokenLength-byte secret.');
    lockbox.commit();
  } finally {
    lockbox.close();
    contentKey.close();
  }
}
0
likes
150
points
1.11k
downloads

Documentation

API reference

Publisher

unverified uploader

Weekly Downloads

Typed Dart FFI bindings for encrypted reVault lockboxes, credentials, keys, form records, and local vault metadata on Android, Linux, macOS, and Windows.

Homepage
Repository (GitHub)
View/report issues

Topics

#encryption #credentials #archive #security #ffi

License

unknown (license)

Dependencies

code_assets, ffi, flat_buffers, hooks

More

Packages that depend on revault_api