michael@0: /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- michael@0: * michael@0: * This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef _NSSDR_H_ michael@0: #define _NSSDR_H_ michael@0: michael@0: #include "nsISecretDecoderRing.h" michael@0: michael@0: /** michael@0: * NS_SDR_CONTRACTID - contract id for SDR services. michael@0: * Implements nsISecretDecoderRing. michael@0: * Should eventually implement an interface to set window michael@0: * context and other information. (nsISecretDecoderRingConfig) michael@0: * michael@0: * NOTE: This definition should move to base code. It michael@0: * is conditionally defined here until it is moved. michael@0: * Delete this after defining in the new location. michael@0: */ michael@0: #ifndef NS_SDR_CONTRACTID michael@0: #define NS_SDR_CONTRACTID "@mozilla.org/security/sdr;1" michael@0: #endif michael@0: michael@0: // =============================================== michael@0: // nsSecretDecoderRing - implementation of nsISecretDecoderRing michael@0: // =============================================== michael@0: michael@0: #define NS_SDR_CID \ michael@0: { 0x0c4f1ddc, 0x1dd2, 0x11b2, { 0x9d, 0x95, 0xf2, 0xfd, 0xf1, 0x13, 0x04, 0x4b } } michael@0: michael@0: class nsSecretDecoderRing michael@0: : public nsISecretDecoderRing, michael@0: public nsISecretDecoderRingConfig michael@0: { michael@0: public: michael@0: NS_DECL_ISUPPORTS michael@0: NS_DECL_NSISECRETDECODERRING michael@0: NS_DECL_NSISECRETDECODERRINGCONFIG michael@0: michael@0: nsSecretDecoderRing(); michael@0: virtual ~nsSecretDecoderRing(); michael@0: michael@0: private: michael@0: michael@0: /** michael@0: * encode - encodes binary into BASE64 string. michael@0: * decode - decode BASE64 string into binary. michael@0: */ michael@0: nsresult encode(const unsigned char *data, int32_t dataLen, char **_retval); michael@0: nsresult decode(const char *data, unsigned char **result, int32_t * _retval); michael@0: michael@0: }; michael@0: michael@0: #endif /* _NSSDR_H_ */