Skip to main content

kdbx 2.6.0 copy "kdbx: ^2.6.0" to clipboard
kdbx: ^2.6.0 copied to clipboard

KeepassX format implementation in pure dart. (kdbx 3.x and 4.x support).

example/kdbx_example.dart

import 'package:kdbx/kdbx.dart';

Future<void> main() async {
  final credentials = Credentials(ProtectedValue.fromString('Lorem Ipsum'));
  final kdbx = KdbxFormat().create(credentials, 'Example');

  final group = kdbx.body.rootGroup;
  final entry = KdbxEntry.create(kdbx, group);
  group.addEntry(entry);
  entry.setString(KdbxKeyCommon.USER_NAME, PlainValue('example user'));
  entry.setString(
    KdbxKeyCommon.PASSWORD,
    ProtectedValue.fromString('password'),
  );

  // Awaited: `save()` is asynchronous and hands back the file as bytes, so
  // dropping the future means the write may not have happened.
  final bytes = await kdbx.save();

  final reopened = await KdbxFormat().read(bytes, credentials);
  final user = reopened.body.rootGroup.entries.single
      .getString(KdbxKeyCommon.USER_NAME)
      ?.getText();
  print('Saved ${bytes.length} bytes and read back user: $user');
}
12
likes
120
points
908
downloads

Documentation

API reference

Publisher

verified publishercodeux.design

Weekly Downloads

KeepassX format implementation in pure dart. (kdbx 3.x and 4.x support).

Repository (GitHub)
View/report issues

License

GPL-3.0 (license)

Dependencies

archive, argon2_ffi_base, args, clock, collection, convert, crypto, isolates, logging, logging_appenders, meta, path, pointycastle, quiver, supercharged_dart, synchronized, uuid, xml

More

Packages that depend on kdbx