1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/security/manager/ssl/public/nsIRecentBadCertsService.idl Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,50 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- 1.5 + * 1.6 + * This Source Code Form is subject to the terms of the Mozilla Public 1.7 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.8 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.9 + 1.10 +#include "nsISupports.idl" 1.11 + 1.12 +interface nsIArray; 1.13 +interface nsIX509Cert; 1.14 +interface nsISSLStatus; 1.15 + 1.16 +%{C++ 1.17 +#define NS_RECENTBADCERTS_CONTRACTID "@mozilla.org/security/recentbadcerts;1" 1.18 +%} 1.19 + 1.20 +/** 1.21 + * This represents a global list of recently seen bad ssl status 1.22 + * including the bad cert. 1.23 + * The implementation will decide how many entries it will hold, 1.24 + * the number is expected to be small. 1.25 + */ 1.26 +[scriptable, uuid(0fed7784-d152-44d6-95a7-67a59024de0f)] 1.27 +interface nsIRecentBadCerts : nsISupports { 1.28 + /** 1.29 + * Retrieve the recently seen bad ssl status for the given hostname:port. 1.30 + * If no SSL cert was recently seen for the given hostname:port, return null. 1.31 + * If a good cert was seen for the given hostname:port, return null. 1.32 + * 1.33 + * @param aHostNameWithPort The host:port whose entry should be tested 1.34 + * @return null or a recently seen bad ssl status with cert 1.35 + */ 1.36 + nsISSLStatus getRecentBadCert(in AString aHostNameWithPort); 1.37 + 1.38 + /** 1.39 + * A bad certificate that should be remembered by the service. 1.40 + * Will be added as the most recently seen cert. 1.41 + * The service may forget older entries to make room for the new one. 1.42 + * 1.43 + * @param aHostNameWithPort The host:port whose entry should be tested 1.44 + * @param aCert The bad ssl status with certificate 1.45 + */ 1.46 + void addBadCert(in AString aHostNameWithPort, 1.47 + in nsISSLStatus aStatus); 1.48 + 1.49 + /** 1.50 + * Clear all stored cert data. 1.51 + */ 1.52 + void resetStoredCerts(); 1.53 +};