Added constructor which accepts Credential.