platform static method

Future<DVAppKeyStore> platform(
  1. String app, {
  2. String? home,
  3. bool? secretService,
  4. String? platform,
  5. DVAppKeyStore androidKeystore(
    1. String app
    )?,
})

The store for app on this machine: the Secret Service when one answers, else the file under home (the user's by default). This is what a running application hands to DVAppKey.ensure at first start, so the key is generated per install and per user into custody the OS protects, and never held only in memory.

Implementation

static Future<DVAppKeyStore> platform(
  String app, {
  String? home,
  bool? secretService,
  String? platform,
  DVAppKeyStore Function(String app)? androidKeystore,
}) async {
  final String os = platform ?? dvHostOperatingSystem();
  return choose(
    app: app,
    home: home ?? dvHostHome() ?? '.',
    platform: os,
    // Only Linux asks: elsewhere the answer changes nothing, and asking
    // loads libsecret for no reason.
    secretService: os != 'linux'
        ? false
        : secretService ?? await DVSecretServiceAppKeyStore.isAvailable(),
    androidKeystore: androidKeystore,
  );
}