I got this error after deleting the default keychain expecting that MacOS will pick the available one as default but it did not.
security: cert import failed: A default keychain could not be found. security: problem decoding
I want to set the default keychain using cli