#ifndef CMS_PKI_CRL_H_INCLUDED
#define  CMS_PKI_CRL_H_INCLUDED

#include <iostream>
#include <vector>

#include "pki/icrl.h"
#include "../common/common.h"
#include "../stdafx.h"
#include "pki.h"
#include "../utils/tools.h"

class CRL : public ICRL {
public:
	CRL();
	CRL(PCCRL_CONTEXT pCrlContext);
	~CRL();

	//properties
	Handle<std::string> getProviderName();
	long getVersion();
	Handle<std::string> getThumbprint();
	Handle<std::string> getThisUpdate();
	Handle<std::string> getNextUpdate();
	Handle<std::string> getSignatureAlgorithm();
	Handle<std::string> getSignatureDigestAlgorithm();
	Handle<std::string> getAuthorityKeyid();
	unsigned int getCrlNumber();
	Handle<std::string> getIssuerFriendlyName();
	Handle<std::string> getIssuerName();

	//Methods
	void read(Handle<std::string> in, DataFormat::DATA_FORMAT format);
	void write(Handle<std::string> out, DataFormat::DATA_FORMAT format);
	void import(Handle<std::string> data, DataFormat::DATA_FORMAT format);
	Handle<ICRL> duplicate();
	int compare(Handle<ICRL> crl);
	bool equals(Handle<ICRL> crl);
	Handle<std::string> hash();
	Handle<std::string> hash(Handle<std::string> algorithm);
	Handle<std::string> hash(ALG_ID algId);
	Handle<std::string> getCRLEncoded(DataFormat::DATA_FORMAT format);

	PCCRL_CONTEXT getCrlContext();

protected:
	/*!
	* \brief Контекст CRL
	*/
	PCCRL_CONTEXT m_pCrlContext;
};

#endif //!CMS_PKI_CRL_H_INCLUDED
