public function getCredentialObject($userId = null)
    {
        if ($userId == null && array_key_exists($this->defaultAccountName, $this->credentialHashmap)) {
            $credObj = $this->credentialHashmap[$this->defaultAccountName];
        } else if (array_key_exists($userId, $this->credentialHashmap)) {
            $credObj = $this->credentialHashmap[$userId];
        }

        if (empty($credObj)) {
            throw new BlockCypherInvalidCredentialException("Credential not found for " . ($userId ? $userId : " default user") .
                ". Please make sure your configuration/APIContext has credential information");
        }
        return $credObj;
    }