[PULL 30/32] crypto: expand logic to cope with multiple certificate identities