#ifndef CHROME_BROWSER_CHROMEOS_POLICY_POLICY_CERT_VERIFIER_H_
#define CHROME_BROWSER_CHROMEOS_POLICY_POLICY_CERT_VERIFIER_H_
#include <vector>
#include "base/basictypes.h"
#include "base/callback.h"
#include "base/compiler_specific.h"
#include "base/memory/ref_counted.h"
#include "base/memory/scoped_ptr.h"
#include "net/base/completion_callback.h"
#include "net/cert/cert_trust_anchor_provider.h"
#include "net/cert/cert_verifier.h"
namespace net {
class CertVerifyProc;
class CertVerifyResult;
class X509Certificate;
typedef std::vector<scoped_refptr<X509Certificate> > CertificateList;
}
namespace policy {
class PolicyCertVerifier : public net::CertVerifier,
public net::CertTrustAnchorProvider {
public:
explicit PolicyCertVerifier(const base::Closure& anchor_used_callback);
virtual ~PolicyCertVerifier();
void InitializeOnIOThread(
const scoped_refptr<net::CertVerifyProc>& verify_proc);
void SetTrustAnchors(const net::CertificateList& trust_anchors);
virtual int Verify(net::X509Certificate* cert,
const std::string& hostname,
int flags,
net::CRLSet* crl_set,
net::CertVerifyResult* verify_result,
const net::CompletionCallback& callback,
RequestHandle* out_req,
const net::BoundNetLog& net_log) OVERRIDE;
virtual void CancelRequest(RequestHandle req) OVERRIDE;
virtual const net::CertificateList& GetAdditionalTrustAnchors() OVERRIDE;
private:
net::CertificateList trust_anchors_;
base::Closure anchor_used_callback_;
scoped_ptr<CertVerifier> delegate_;
DISALLOW_COPY_AND_ASSIGN(PolicyCertVerifier);
};
}
#endif