2007-03-22 10:30:00 -07:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
|
|
|
|
*
|
2012-05-21 04:12:37 -07:00
|
|
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
#include "nsISupports.idl"
|
|
|
|
|
2007-10-30 13:26:25 -07:00
|
|
|
[scriptable, uuid(3a5c7a0f-f5da-4a8b-a748-d7c5a528f33b)]
|
2007-03-22 10:30:00 -07:00
|
|
|
interface nsINSSErrorsService : nsISupports
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* @param aNSPRCode An error code obtained using PR_GetError()
|
|
|
|
* @return True if it is error code defined by the NSS library
|
|
|
|
*/
|
2012-08-22 08:56:38 -07:00
|
|
|
boolean isNSSErrorCode(in int32_t aNSPRCode);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function will fail if aNSPRCode is not an NSS error code.
|
|
|
|
* @param aNSPRCode An error code obtained using PR_GetError()
|
|
|
|
* @return The result of the conversion, an XPCOM error code
|
|
|
|
*/
|
2012-08-22 08:56:38 -07:00
|
|
|
nsresult getXPCOMFromNSSError(in int32_t aNSPRCode);
|
2007-03-22 10:30:00 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function will fail if aXPCOMErrorCode is not an NSS error code.
|
|
|
|
* @param aXPCOMErrorCode An error code obtain using getXPCOMFromNSSError
|
|
|
|
* return A localized human readable error explanation.
|
|
|
|
*/
|
|
|
|
AString getErrorMessage(in nsresult aXPCOMErrorCode);
|
2007-10-30 13:26:25 -07:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Function will fail if aXPCOMErrorCode is not an NSS error code.
|
|
|
|
* @param aXPCOMErrorCode An error code obtain using getXPCOMFromNSSError
|
|
|
|
* return the
|
|
|
|
*/
|
2012-08-22 08:56:38 -07:00
|
|
|
uint32_t getErrorClass(in nsresult aXPCOMErrorCode);
|
2007-10-30 13:26:25 -07:00
|
|
|
|
|
|
|
const unsigned long ERROR_CLASS_SSL_PROTOCOL = 1;
|
|
|
|
const unsigned long ERROR_CLASS_BAD_CERT = 2;
|
2007-12-04 10:53:14 -08:00
|
|
|
|
|
|
|
/**
|
|
|
|
* The following values define the range of NSPR error codes used by NSS.
|
|
|
|
* NSS remains the authorative source for these numbers, as a result,
|
|
|
|
* the values might change in the future.
|
|
|
|
* The security module will perform a runtime check and assertion
|
|
|
|
* to ensure the values are in synch with NSS.
|
|
|
|
*/
|
2007-12-04 11:38:27 -08:00
|
|
|
const long NSS_SEC_ERROR_BASE = -(0x2000);
|
2007-12-04 10:53:14 -08:00
|
|
|
const long NSS_SEC_ERROR_LIMIT = (NSS_SEC_ERROR_BASE + 1000);
|
2007-12-04 11:38:27 -08:00
|
|
|
const long NSS_SSL_ERROR_BASE = -(0x3000);
|
2007-12-04 10:53:14 -08:00
|
|
|
const long NSS_SSL_ERROR_LIMIT = (NSS_SSL_ERROR_BASE + 1000);
|
2007-03-22 10:30:00 -07:00
|
|
|
};
|