I was having a problem with codesigning my apps, so I deleted all the keys from the keychain. Then I went to Certificate Assistant => Request a certificate from a Certif
Below link resolved the issue for me. https://forums.developer.apple.com/thread/72863
In my case it was the yubikey which was connected to my Mac all the time. After removing it, issue got resolved automatically.