unlockKeyChain method

Future<void> unlockKeyChain(
  1. String name,
  2. Secret password
)

Implementation

Future<void> unlockKeyChain(
  String name,
  Secret password,
) async {
  final keyChainPath = await _getKeyChainPath(name);
  if (keyChainPath == null) {
    throw ImpaktfullCliError(
        '`$name` keychain does not exists. In order to unlock a keychain, it should be created first.');
  }
  final fullName = _fullKeyChainName(name);
  await processRunner
      .runProcess(['security', 'set-keychain-settings', fullName]);
  await processRunner.runProcess(
      ['security', 'unlock-keychain', '-p', password.value, fullName]);
}