heldSigningKeys property

Future<List<ApkamSigningKeys>> get heldSigningKeys
inherited

What the keyfile holds for enrollmentId, filtered to what this build can sign an envelope with. Empty when the client has no key source or no keyfile, or when the enrollment holds none; a keyfile that cannot be read throws.

Implementation

Future<List<ApkamSigningKeys>> get heldSigningKeys async {
  final keys = await _readKeyfile('signing keys');
  if (keys == null) return const [];

  return [
    for (final key in keys.signingKeysFor(enrollmentId))
      if (canSignEnvelopeWith(key.algorithm))
        ApkamSigningKeys(
          algorithm: key.algorithm,
          publicKey: key.publicKey,
          privateKey: key.privateKey,
        )
  ];
}