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

Typed Dart FFI bindings for encrypted reVault lockboxes, credentials, keys, form records, and local vault metadata on 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
693
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 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