Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
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/. */
7 #ifndef _NSSDR_H_
8 #define _NSSDR_H_
10 #include "nsISecretDecoderRing.h"
12 /**
13 * NS_SDR_CONTRACTID - contract id for SDR services.
14 * Implements nsISecretDecoderRing.
15 * Should eventually implement an interface to set window
16 * context and other information. (nsISecretDecoderRingConfig)
17 *
18 * NOTE: This definition should move to base code. It
19 * is conditionally defined here until it is moved.
20 * Delete this after defining in the new location.
21 */
22 #ifndef NS_SDR_CONTRACTID
23 #define NS_SDR_CONTRACTID "@mozilla.org/security/sdr;1"
24 #endif
26 // ===============================================
27 // nsSecretDecoderRing - implementation of nsISecretDecoderRing
28 // ===============================================
30 #define NS_SDR_CID \
31 { 0x0c4f1ddc, 0x1dd2, 0x11b2, { 0x9d, 0x95, 0xf2, 0xfd, 0xf1, 0x13, 0x04, 0x4b } }
33 class nsSecretDecoderRing
34 : public nsISecretDecoderRing,
35 public nsISecretDecoderRingConfig
36 {
37 public:
38 NS_DECL_ISUPPORTS
39 NS_DECL_NSISECRETDECODERRING
40 NS_DECL_NSISECRETDECODERRINGCONFIG
42 nsSecretDecoderRing();
43 virtual ~nsSecretDecoderRing();
45 private:
47 /**
48 * encode - encodes binary into BASE64 string.
49 * decode - decode BASE64 string into binary.
50 */
51 nsresult encode(const unsigned char *data, int32_t dataLen, char **_retval);
52 nsresult decode(const char *data, unsigned char **result, int32_t * _retval);
54 };
56 #endif /* _NSSDR_H_ */