|
1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- |
|
2 * |
|
3 * This Source Code Form is subject to the terms of the Mozilla Public |
|
4 * License, v. 2.0. If a copy of the MPL was not distributed with this |
|
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
|
6 |
|
7 #include "nsISupports.idl" |
|
8 |
|
9 interface nsIArray; |
|
10 interface nsIX509Cert; |
|
11 interface nsISSLStatus; |
|
12 |
|
13 %{C++ |
|
14 #define NS_RECENTBADCERTS_CONTRACTID "@mozilla.org/security/recentbadcerts;1" |
|
15 %} |
|
16 |
|
17 /** |
|
18 * This represents a global list of recently seen bad ssl status |
|
19 * including the bad cert. |
|
20 * The implementation will decide how many entries it will hold, |
|
21 * the number is expected to be small. |
|
22 */ |
|
23 [scriptable, uuid(0fed7784-d152-44d6-95a7-67a59024de0f)] |
|
24 interface nsIRecentBadCerts : nsISupports { |
|
25 /** |
|
26 * Retrieve the recently seen bad ssl status for the given hostname:port. |
|
27 * If no SSL cert was recently seen for the given hostname:port, return null. |
|
28 * If a good cert was seen for the given hostname:port, return null. |
|
29 * |
|
30 * @param aHostNameWithPort The host:port whose entry should be tested |
|
31 * @return null or a recently seen bad ssl status with cert |
|
32 */ |
|
33 nsISSLStatus getRecentBadCert(in AString aHostNameWithPort); |
|
34 |
|
35 /** |
|
36 * A bad certificate that should be remembered by the service. |
|
37 * Will be added as the most recently seen cert. |
|
38 * The service may forget older entries to make room for the new one. |
|
39 * |
|
40 * @param aHostNameWithPort The host:port whose entry should be tested |
|
41 * @param aCert The bad ssl status with certificate |
|
42 */ |
|
43 void addBadCert(in AString aHostNameWithPort, |
|
44 in nsISSLStatus aStatus); |
|
45 |
|
46 /** |
|
47 * Clear all stored cert data. |
|
48 */ |
|
49 void resetStoredCerts(); |
|
50 }; |