Use changes done as part of #5239 to the Credential class