michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #include "nsISupports.idl" michael@0: michael@0: interface nsIArray; michael@0: interface nsIX509Cert; michael@0: interface nsISSLStatus; michael@0: michael@0: %{C++ michael@0: #define NS_RECENTBADCERTS_CONTRACTID "@mozilla.org/security/recentbadcerts;1" michael@0: %} michael@0: michael@0: /** michael@0: * This represents a global list of recently seen bad ssl status michael@0: * including the bad cert. michael@0: * The implementation will decide how many entries it will hold, michael@0: * the number is expected to be small. michael@0: */ michael@0: [scriptable, uuid(0fed7784-d152-44d6-95a7-67a59024de0f)] michael@0: interface nsIRecentBadCerts : nsISupports { michael@0: /** michael@0: * Retrieve the recently seen bad ssl status for the given hostname:port. michael@0: * If no SSL cert was recently seen for the given hostname:port, return null. michael@0: * If a good cert was seen for the given hostname:port, return null. michael@0: * michael@0: * @param aHostNameWithPort The host:port whose entry should be tested michael@0: * @return null or a recently seen bad ssl status with cert michael@0: */ michael@0: nsISSLStatus getRecentBadCert(in AString aHostNameWithPort); michael@0: michael@0: /** michael@0: * A bad certificate that should be remembered by the service. michael@0: * Will be added as the most recently seen cert. michael@0: * The service may forget older entries to make room for the new one. michael@0: * michael@0: * @param aHostNameWithPort The host:port whose entry should be tested michael@0: * @param aCert The bad ssl status with certificate michael@0: */ michael@0: void addBadCert(in AString aHostNameWithPort, michael@0: in nsISSLStatus aStatus); michael@0: michael@0: /** michael@0: * Clear all stored cert data. michael@0: */ michael@0: void resetStoredCerts(); michael@0: };