1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
3 * ***** BEGIN LICENSE BLOCK *****
4 * Version: MPL 1.1/GPL 2.0/LGPL 2.1
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 1.1 (the "License"); you may not use this file except in compliance with
8 * the License. You may obtain a copy of the License at
9 * http://www.mozilla.org/MPL/
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
16 * The Original Code is mozilla.org code.
18 * The Initial Developer of the Original Code is
20 * Portions created by the Initial Developer are Copyright (C) 2007
21 * the Initial Developer. All Rights Reserved.
24 * Kai Engert <kengert@redhat.com>
26 * Alternatively, the contents of this file may be used under the terms of
27 * either the GNU General Public License Version 2 or later (the "GPL"), or
28 * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
29 * in which case the provisions of the GPL or the LGPL are applicable instead
30 * of those above. If you wish to allow use of your version of this file only
31 * under the terms of either the GPL or the LGPL, and not to allow others to
32 * use your version of this file under the terms of the MPL, indicate your
33 * decision by deleting the provisions above and replace them with the notice
34 * and other provisions required by the GPL or the LGPL. If you do not delete
35 * the provisions above, a recipient may use your version of this file under
36 * the terms of any one of the MPL, the GPL or the LGPL.
38 * ***** END LICENSE BLOCK ***** */
40 #include
"nsISupports.idl"
42 [scriptable
, uuid(3a5c7a0f
-f5da
-4a8b
-a748
-d7c5a528f33b
)]
43 interface nsINSSErrorsService
: nsISupports
46 * @param aNSPRCode An error code obtained using PR_GetError()
47 * @return True if it is error code defined by the NSS library
49 boolean isNSSErrorCode
(in PRInt32 aNSPRCode
);
52 * Function will fail if aNSPRCode is not an NSS error code.
53 * @param aNSPRCode An error code obtained using PR_GetError()
54 * @return The result of the conversion, an XPCOM error code
56 nsresult getXPCOMFromNSSError
(in PRInt32 aNSPRCode
);
59 * Function will fail if aXPCOMErrorCode is not an NSS error code.
60 * @param aXPCOMErrorCode An error code obtain using getXPCOMFromNSSError
61 * return A localized human readable error explanation.
63 AString getErrorMessage
(in nsresult aXPCOMErrorCode
);
66 * Function will fail if aXPCOMErrorCode is not an NSS error code.
67 * @param aXPCOMErrorCode An error code obtain using getXPCOMFromNSSError
70 PRUint32 getErrorClass
(in nsresult aXPCOMErrorCode
);
72 const unsigned long ERROR_CLASS_SSL_PROTOCOL
= 1;
73 const unsigned long ERROR_CLASS_BAD_CERT
= 2;
76 * The following values define the range of NSPR error codes used by NSS.
77 * NSS remains the authorative source for these numbers, as a result,
78 * the values might change in the future.
79 * The security module will perform a runtime check and assertion
80 * to ensure the values are in synch with NSS.
82 const long NSS_SEC_ERROR_BASE
= -(0x2000);
83 const long NSS_SEC_ERROR_LIMIT
= (NSS_SEC_ERROR_BASE
+ 1000);
84 const long NSS_SSL_ERROR_BASE
= -(0x3000);
85 const long NSS_SSL_ERROR_LIMIT
= (NSS_SSL_ERROR_BASE
+ 1000);