blob: 56d2ae7f3d0419d613a4c95800fb27bbf65de24d [file] [log] [blame]
// Copyright 2015 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include "ios/web/net/cert_host_pair.h"
#include <utility>
#include "net/cert/x509_certificate.h"
namespace web {
CertHostPair::CertHostPair(scoped_refptr<net::X509Certificate> cert,
std::string host)
: cert_(std::move(cert)),
host_(std::move(host)),
cert_hash_(cert_->CalculateChainFingerprint256()) {}
CertHostPair::CertHostPair(const CertHostPair& other) = default;
CertHostPair::~CertHostPair() {}
bool CertHostPair::operator<(const CertHostPair& other) const {
return std::tie(host_, cert_hash_) < std::tie(other.host_, other.cert_hash_);
}
} // web