~ubuntu-branches/ubuntu/oneiric/weave/oneiric

« back to all changes in this revision

Viewing changes to services/crypto/IWeaveCrypto.h

  • Committer: Bazaar Package Importer
  • Author(s): Micah Gersten
  • Date: 2010-08-11 00:35:15 UTC
  • mfrom: (3.1.2 sid)
  • Revision ID: james.westby@ubuntu.com-20100811003515-o3jbh826bnd1syjv
Tags: 1.4.3-1ubuntu1
* Add -fshort-wchar to CXXFLAGS to fix FTBFS in Ubuntu
  - update debian/rules 

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
 * DO NOT EDIT.  THIS FILE IS GENERATED FROM IWeaveCrypto.idl
 
3
 */
 
4
 
 
5
#ifndef __gen_IWeaveCrypto_h__
 
6
#define __gen_IWeaveCrypto_h__
 
7
 
 
8
 
 
9
#ifndef __gen_nsISupports_h__
 
10
#include "nsISupports.h"
 
11
#endif
 
12
 
 
13
/* For IDL files that don't want to include root IDL files. */
 
14
#ifndef NS_NO_VTABLE
 
15
#define NS_NO_VTABLE
 
16
#endif
 
17
 
 
18
/* starting interface:    IWeaveCrypto */
 
19
#define IWEAVECRYPTO_IID_STR "f4463043-315e-41f3-b779-82e900e6fffa"
 
20
 
 
21
#define IWEAVECRYPTO_IID \
 
22
  {0xf4463043, 0x315e, 0x41f3, \
 
23
    { 0xb7, 0x79, 0x82, 0xe9, 0x00, 0xe6, 0xff, 0xfa }}
 
24
 
 
25
class NS_NO_VTABLE NS_SCRIPTABLE IWeaveCrypto : public nsISupports {
 
26
 public: 
 
27
 
 
28
  NS_DECLARE_STATIC_IID_ACCESSOR(IWEAVECRYPTO_IID)
 
29
 
 
30
  /**
 
31
   * Shortcuts for some algorithm SEC OIDs.  Full list available here:
 
32
   * http://lxr.mozilla.org/seamonkey/source/security/nss/lib/util/secoidt.h
 
33
   */
 
34
  enum { DES_EDE3_CBC = 156U };
 
35
 
 
36
  enum { AES_128_CBC = 184U };
 
37
 
 
38
  enum { AES_192_CBC = 186U };
 
39
 
 
40
  enum { AES_256_CBC = 188U };
 
41
 
 
42
  /**
 
43
   * One of the above constants. Used as the mechanism for encrypting bulk
 
44
   * data and wrapping keys.
 
45
   *
 
46
   * Default is AES_256_CBC.
 
47
   */
 
48
  /* attribute unsigned long algorithm; */
 
49
  NS_SCRIPTABLE NS_IMETHOD GetAlgorithm(PRUint32 *aAlgorithm) = 0;
 
50
  NS_SCRIPTABLE NS_IMETHOD SetAlgorithm(PRUint32 aAlgorithm) = 0;
 
51
 
 
52
  /**
 
53
   * The size of the RSA key to create with generateKeypair().
 
54
   *
 
55
   * Default is 2048.
 
56
   */
 
57
  /* attribute unsigned long keypairBits; */
 
58
  NS_SCRIPTABLE NS_IMETHOD GetKeypairBits(PRUint32 *aKeypairBits) = 0;
 
59
  NS_SCRIPTABLE NS_IMETHOD SetKeypairBits(PRUint32 aKeypairBits) = 0;
 
60
 
 
61
  /**
 
62
   * Encrypt data using a symmetric key.
 
63
   * The algorithm attribute specifies how the encryption is performed.
 
64
   *
 
65
   * @param   clearText
 
66
   *          The data to be encrypted (not base64 encoded).
 
67
   * @param   symmetricKey
 
68
   *          A base64-encoded symmetric key (eg, one from generateRandomKey).
 
69
   * @param   iv
 
70
   *          A base64-encoded initialization vector
 
71
   * @returns Encrypted data, base64 encoded
 
72
   */
 
73
  /* ACString encrypt (in AUTF8String clearText, in ACString symmetricKey, in ACString iv); */
 
74
  NS_SCRIPTABLE NS_IMETHOD Encrypt(const nsACString & clearText, const nsACString & symmetricKey, const nsACString & iv, nsACString & _retval NS_OUTPARAM) = 0;
 
75
 
 
76
  /**
 
77
   * Encrypt data using a symmetric key.
 
78
   * The algorithm attribute specifies how the encryption is performed.
 
79
   *
 
80
   * @param   cipherText
 
81
   *          The base64-encoded data to be decrypted
 
82
   * @param   symmetricKey
 
83
   *          A base64-encoded symmetric key (eg, one from unwrapSymmetricKey)
 
84
   * @param   iv
 
85
   *          A base64-encoded initialization vector
 
86
   * @returns Decrypted data (not base64-encoded)
 
87
   */
 
88
  /* AUTF8String decrypt (in ACString cipherText, in ACString symmetricKey, in ACString iv); */
 
89
  NS_SCRIPTABLE NS_IMETHOD Decrypt(const nsACString & cipherText, const nsACString & symmetricKey, const nsACString & iv, nsACString & _retval NS_OUTPARAM) = 0;
 
90
 
 
91
  /**
 
92
   * Generate a RSA public/private keypair.
 
93
   *
 
94
   * @param aPassphrase
 
95
   *        User's passphrase. Used with PKCS#5 to generate a symmetric key
 
96
   *        for wrapping the private key.
 
97
   * @param aSalt
 
98
   *        Salt for the user's passphrase.
 
99
   * @param aIV
 
100
   *        Random IV, used when wrapping the private key.
 
101
   * @param aEncodedPublicKey
 
102
   *        The public key, base-64 encoded.
 
103
   * @param aWrappedPrivateKey
 
104
   *        The public key, encrypted with the user's passphrase, and base-64 encoded.
 
105
   */
 
106
  /* void generateKeypair (in ACString aPassphrase, in ACString aSalt, in ACString aIV, out ACString aEncodedPublicKey, out ACString aWrappedPrivateKey); */
 
107
  NS_SCRIPTABLE NS_IMETHOD GenerateKeypair(const nsACString & aPassphrase, const nsACString & aSalt, const nsACString & aIV, nsACString & aEncodedPublicKey NS_OUTPARAM, nsACString & aWrappedPrivateKey NS_OUTPARAM) = 0;
 
108
 
 
109
  /* ACString generateRandomKey (); */
 
110
  NS_SCRIPTABLE NS_IMETHOD GenerateRandomKey(nsACString & _retval NS_OUTPARAM) = 0;
 
111
 
 
112
  /* ACString generateRandomIV (); */
 
113
  NS_SCRIPTABLE NS_IMETHOD GenerateRandomIV(nsACString & _retval NS_OUTPARAM) = 0;
 
114
 
 
115
  /* ACString generateRandomBytes (in unsigned long aByteCount); */
 
116
  NS_SCRIPTABLE NS_IMETHOD GenerateRandomBytes(PRUint32 aByteCount, nsACString & _retval NS_OUTPARAM) = 0;
 
117
 
 
118
  /**
 
119
   * Encrypts a symmetric key with a user's public key.
 
120
   *
 
121
   * @param aSymmetricKey
 
122
   *        The base64 encoded string holding a symmetric key.
 
123
   * @param aEncodedPublicKey
 
124
   *        The base64 encoded string holding a public key.
 
125
   * @returns The wrapped symmetric key, base64 encoded
 
126
   *
 
127
   * For RSA, the unencoded public key is a PKCS#1 object.
 
128
   */
 
129
  /* ACString wrapSymmetricKey (in ACString aSymmetricKey, in ACString aEncodedPublicKey); */
 
130
  NS_SCRIPTABLE NS_IMETHOD WrapSymmetricKey(const nsACString & aSymmetricKey, const nsACString & aEncodedPublicKey, nsACString & _retval NS_OUTPARAM) = 0;
 
131
 
 
132
  /**
 
133
   * Decrypts a symmetric key with a user's private key.
 
134
   *
 
135
   * @param aWrappedSymmetricKey
 
136
   *        The base64 encoded string holding an encrypted symmetric key.
 
137
   * @param aWrappedPrivateKey
 
138
   *        The base64 encoded string holdering an encrypted private key.
 
139
   * @param aPassphrase
 
140
   *        The passphrase to decrypt the private key.
 
141
   * @param aSalt
 
142
   *        The salt for the passphrase.
 
143
   * @param aIV
 
144
   *        The random IV used when unwrapping the private key.
 
145
   * @returns The unwrapped symmetric key, base64 encoded
 
146
   *
 
147
   * For RSA, the unencoded, decrypted key is a PKCS#1 object.
 
148
   */
 
149
  /* ACString unwrapSymmetricKey (in ACString aWrappedSymmetricKey, in ACString aWrappedPrivateKey, in ACString aPassphrase, in ACString aSalt, in ACString aIV); */
 
150
  NS_SCRIPTABLE NS_IMETHOD UnwrapSymmetricKey(const nsACString & aWrappedSymmetricKey, const nsACString & aWrappedPrivateKey, const nsACString & aPassphrase, const nsACString & aSalt, const nsACString & aIV, nsACString & _retval NS_OUTPARAM) = 0;
 
151
 
 
152
  /**
 
153
   * Rewrap a private key with a new user passphrase.
 
154
   *
 
155
   * @param aWrappedPrivateKey
 
156
   *        The base64 encoded string holding an encrypted private key.
 
157
   * @param aPassphrase
 
158
   *        The passphrase to decrypt the private key.
 
159
   * @param aSalt
 
160
   *        The salt for the passphrase.
 
161
   * @param aIV
 
162
   *        The random IV used when unwrapping the private key.
 
163
   * @param aNewPassphrase
 
164
   *        The new passphrase to wrap the private key with.
 
165
   * @returns The (re)wrapped private key, base64 encoded
 
166
   *
 
167
   */
 
168
  /* ACString rewrapPrivateKey (in ACString aWrappedPrivateKey, in ACString aPassphrase, in ACString aSalt, in ACString aIV, in ACString aNewPassphrase); */
 
169
  NS_SCRIPTABLE NS_IMETHOD RewrapPrivateKey(const nsACString & aWrappedPrivateKey, const nsACString & aPassphrase, const nsACString & aSalt, const nsACString & aIV, const nsACString & aNewPassphrase, nsACString & _retval NS_OUTPARAM) = 0;
 
170
 
 
171
  /**
 
172
    * Verify a user's passphrase against a private key.
 
173
    *
 
174
    * @param aWrappedPrivateKey
 
175
    *        The base64 encoded string holding an encrypted private key.
 
176
    * @param aPassphrase
 
177
    *        The passphrase to decrypt the private key.
 
178
    * @param aSalt
 
179
    *        The salt for the passphrase.
 
180
    * @param aIV
 
181
    *        The random IV used when unwrapping the private key.
 
182
    * @returns Boolean true if the passphrase decrypted the key correctly.
 
183
    *
 
184
    */
 
185
  /* boolean verifyPassphrase (in ACString aWrappedPrivateKey, in ACString aPassphrase, in ACString aSalt, in ACString aIV); */
 
186
  NS_SCRIPTABLE NS_IMETHOD VerifyPassphrase(const nsACString & aWrappedPrivateKey, const nsACString & aPassphrase, const nsACString & aSalt, const nsACString & aIV, PRBool *_retval NS_OUTPARAM) = 0;
 
187
 
 
188
};
 
189
 
 
190
  NS_DEFINE_STATIC_IID_ACCESSOR(IWeaveCrypto, IWEAVECRYPTO_IID)
 
191
 
 
192
/* Use this macro when declaring classes that implement this interface. */
 
193
#define NS_DECL_IWEAVECRYPTO \
 
194
  NS_SCRIPTABLE NS_IMETHOD GetAlgorithm(PRUint32 *aAlgorithm); \
 
195
  NS_SCRIPTABLE NS_IMETHOD SetAlgorithm(PRUint32 aAlgorithm); \
 
196
  NS_SCRIPTABLE NS_IMETHOD GetKeypairBits(PRUint32 *aKeypairBits); \
 
197
  NS_SCRIPTABLE NS_IMETHOD SetKeypairBits(PRUint32 aKeypairBits); \
 
198
  NS_SCRIPTABLE NS_IMETHOD Encrypt(const nsACString & clearText, const nsACString & symmetricKey, const nsACString & iv, nsACString & _retval NS_OUTPARAM); \
 
199
  NS_SCRIPTABLE NS_IMETHOD Decrypt(const nsACString & cipherText, const nsACString & symmetricKey, const nsACString & iv, nsACString & _retval NS_OUTPARAM); \
 
200
  NS_SCRIPTABLE NS_IMETHOD GenerateKeypair(const nsACString & aPassphrase, const nsACString & aSalt, const nsACString & aIV, nsACString & aEncodedPublicKey NS_OUTPARAM, nsACString & aWrappedPrivateKey NS_OUTPARAM); \
 
201
  NS_SCRIPTABLE NS_IMETHOD GenerateRandomKey(nsACString & _retval NS_OUTPARAM); \
 
202
  NS_SCRIPTABLE NS_IMETHOD GenerateRandomIV(nsACString & _retval NS_OUTPARAM); \
 
203
  NS_SCRIPTABLE NS_IMETHOD GenerateRandomBytes(PRUint32 aByteCount, nsACString & _retval NS_OUTPARAM); \
 
204
  NS_SCRIPTABLE NS_IMETHOD WrapSymmetricKey(const nsACString & aSymmetricKey, const nsACString & aEncodedPublicKey, nsACString & _retval NS_OUTPARAM); \
 
205
  NS_SCRIPTABLE NS_IMETHOD UnwrapSymmetricKey(const nsACString & aWrappedSymmetricKey, const nsACString & aWrappedPrivateKey, const nsACString & aPassphrase, const nsACString & aSalt, const nsACString & aIV, nsACString & _retval NS_OUTPARAM); \
 
206
  NS_SCRIPTABLE NS_IMETHOD RewrapPrivateKey(const nsACString & aWrappedPrivateKey, const nsACString & aPassphrase, const nsACString & aSalt, const nsACString & aIV, const nsACString & aNewPassphrase, nsACString & _retval NS_OUTPARAM); \
 
207
  NS_SCRIPTABLE NS_IMETHOD VerifyPassphrase(const nsACString & aWrappedPrivateKey, const nsACString & aPassphrase, const nsACString & aSalt, const nsACString & aIV, PRBool *_retval NS_OUTPARAM); 
 
208
 
 
209
/* Use this macro to declare functions that forward the behavior of this interface to another object. */
 
210
#define NS_FORWARD_IWEAVECRYPTO(_to) \
 
211
  NS_SCRIPTABLE NS_IMETHOD GetAlgorithm(PRUint32 *aAlgorithm) { return _to GetAlgorithm(aAlgorithm); } \
 
212
  NS_SCRIPTABLE NS_IMETHOD SetAlgorithm(PRUint32 aAlgorithm) { return _to SetAlgorithm(aAlgorithm); } \
 
213
  NS_SCRIPTABLE NS_IMETHOD GetKeypairBits(PRUint32 *aKeypairBits) { return _to GetKeypairBits(aKeypairBits); } \
 
214
  NS_SCRIPTABLE NS_IMETHOD SetKeypairBits(PRUint32 aKeypairBits) { return _to SetKeypairBits(aKeypairBits); } \
 
215
  NS_SCRIPTABLE NS_IMETHOD Encrypt(const nsACString & clearText, const nsACString & symmetricKey, const nsACString & iv, nsACString & _retval NS_OUTPARAM) { return _to Encrypt(clearText, symmetricKey, iv, _retval); } \
 
216
  NS_SCRIPTABLE NS_IMETHOD Decrypt(const nsACString & cipherText, const nsACString & symmetricKey, const nsACString & iv, nsACString & _retval NS_OUTPARAM) { return _to Decrypt(cipherText, symmetricKey, iv, _retval); } \
 
217
  NS_SCRIPTABLE NS_IMETHOD GenerateKeypair(const nsACString & aPassphrase, const nsACString & aSalt, const nsACString & aIV, nsACString & aEncodedPublicKey NS_OUTPARAM, nsACString & aWrappedPrivateKey NS_OUTPARAM) { return _to GenerateKeypair(aPassphrase, aSalt, aIV, aEncodedPublicKey, aWrappedPrivateKey); } \
 
218
  NS_SCRIPTABLE NS_IMETHOD GenerateRandomKey(nsACString & _retval NS_OUTPARAM) { return _to GenerateRandomKey(_retval); } \
 
219
  NS_SCRIPTABLE NS_IMETHOD GenerateRandomIV(nsACString & _retval NS_OUTPARAM) { return _to GenerateRandomIV(_retval); } \
 
220
  NS_SCRIPTABLE NS_IMETHOD GenerateRandomBytes(PRUint32 aByteCount, nsACString & _retval NS_OUTPARAM) { return _to GenerateRandomBytes(aByteCount, _retval); } \
 
221
  NS_SCRIPTABLE NS_IMETHOD WrapSymmetricKey(const nsACString & aSymmetricKey, const nsACString & aEncodedPublicKey, nsACString & _retval NS_OUTPARAM) { return _to WrapSymmetricKey(aSymmetricKey, aEncodedPublicKey, _retval); } \
 
222
  NS_SCRIPTABLE NS_IMETHOD UnwrapSymmetricKey(const nsACString & aWrappedSymmetricKey, const nsACString & aWrappedPrivateKey, const nsACString & aPassphrase, const nsACString & aSalt, const nsACString & aIV, nsACString & _retval NS_OUTPARAM) { return _to UnwrapSymmetricKey(aWrappedSymmetricKey, aWrappedPrivateKey, aPassphrase, aSalt, aIV, _retval); } \
 
223
  NS_SCRIPTABLE NS_IMETHOD RewrapPrivateKey(const nsACString & aWrappedPrivateKey, const nsACString & aPassphrase, const nsACString & aSalt, const nsACString & aIV, const nsACString & aNewPassphrase, nsACString & _retval NS_OUTPARAM) { return _to RewrapPrivateKey(aWrappedPrivateKey, aPassphrase, aSalt, aIV, aNewPassphrase, _retval); } \
 
224
  NS_SCRIPTABLE NS_IMETHOD VerifyPassphrase(const nsACString & aWrappedPrivateKey, const nsACString & aPassphrase, const nsACString & aSalt, const nsACString & aIV, PRBool *_retval NS_OUTPARAM) { return _to VerifyPassphrase(aWrappedPrivateKey, aPassphrase, aSalt, aIV, _retval); } 
 
225
 
 
226
/* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
 
227
#define NS_FORWARD_SAFE_IWEAVECRYPTO(_to) \
 
228
  NS_SCRIPTABLE NS_IMETHOD GetAlgorithm(PRUint32 *aAlgorithm) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetAlgorithm(aAlgorithm); } \
 
229
  NS_SCRIPTABLE NS_IMETHOD SetAlgorithm(PRUint32 aAlgorithm) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetAlgorithm(aAlgorithm); } \
 
230
  NS_SCRIPTABLE NS_IMETHOD GetKeypairBits(PRUint32 *aKeypairBits) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetKeypairBits(aKeypairBits); } \
 
231
  NS_SCRIPTABLE NS_IMETHOD SetKeypairBits(PRUint32 aKeypairBits) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetKeypairBits(aKeypairBits); } \
 
232
  NS_SCRIPTABLE NS_IMETHOD Encrypt(const nsACString & clearText, const nsACString & symmetricKey, const nsACString & iv, nsACString & _retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->Encrypt(clearText, symmetricKey, iv, _retval); } \
 
233
  NS_SCRIPTABLE NS_IMETHOD Decrypt(const nsACString & cipherText, const nsACString & symmetricKey, const nsACString & iv, nsACString & _retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->Decrypt(cipherText, symmetricKey, iv, _retval); } \
 
234
  NS_SCRIPTABLE NS_IMETHOD GenerateKeypair(const nsACString & aPassphrase, const nsACString & aSalt, const nsACString & aIV, nsACString & aEncodedPublicKey NS_OUTPARAM, nsACString & aWrappedPrivateKey NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->GenerateKeypair(aPassphrase, aSalt, aIV, aEncodedPublicKey, aWrappedPrivateKey); } \
 
235
  NS_SCRIPTABLE NS_IMETHOD GenerateRandomKey(nsACString & _retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->GenerateRandomKey(_retval); } \
 
236
  NS_SCRIPTABLE NS_IMETHOD GenerateRandomIV(nsACString & _retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->GenerateRandomIV(_retval); } \
 
237
  NS_SCRIPTABLE NS_IMETHOD GenerateRandomBytes(PRUint32 aByteCount, nsACString & _retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->GenerateRandomBytes(aByteCount, _retval); } \
 
238
  NS_SCRIPTABLE NS_IMETHOD WrapSymmetricKey(const nsACString & aSymmetricKey, const nsACString & aEncodedPublicKey, nsACString & _retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->WrapSymmetricKey(aSymmetricKey, aEncodedPublicKey, _retval); } \
 
239
  NS_SCRIPTABLE NS_IMETHOD UnwrapSymmetricKey(const nsACString & aWrappedSymmetricKey, const nsACString & aWrappedPrivateKey, const nsACString & aPassphrase, const nsACString & aSalt, const nsACString & aIV, nsACString & _retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->UnwrapSymmetricKey(aWrappedSymmetricKey, aWrappedPrivateKey, aPassphrase, aSalt, aIV, _retval); } \
 
240
  NS_SCRIPTABLE NS_IMETHOD RewrapPrivateKey(const nsACString & aWrappedPrivateKey, const nsACString & aPassphrase, const nsACString & aSalt, const nsACString & aIV, const nsACString & aNewPassphrase, nsACString & _retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->RewrapPrivateKey(aWrappedPrivateKey, aPassphrase, aSalt, aIV, aNewPassphrase, _retval); } \
 
241
  NS_SCRIPTABLE NS_IMETHOD VerifyPassphrase(const nsACString & aWrappedPrivateKey, const nsACString & aPassphrase, const nsACString & aSalt, const nsACString & aIV, PRBool *_retval NS_OUTPARAM) { return !_to ? NS_ERROR_NULL_POINTER : _to->VerifyPassphrase(aWrappedPrivateKey, aPassphrase, aSalt, aIV, _retval); } 
 
242
 
 
243
#if 0
 
244
/* Use the code below as a template for the implementation class for this interface. */
 
245
 
 
246
/* Header file */
 
247
class _MYCLASS_ : public IWeaveCrypto
 
248
{
 
249
public:
 
250
  NS_DECL_ISUPPORTS
 
251
  NS_DECL_IWEAVECRYPTO
 
252
 
 
253
  _MYCLASS_();
 
254
 
 
255
private:
 
256
  ~_MYCLASS_();
 
257
 
 
258
protected:
 
259
  /* additional members */
 
260
};
 
261
 
 
262
/* Implementation file */
 
263
NS_IMPL_ISUPPORTS1(_MYCLASS_, IWeaveCrypto)
 
264
 
 
265
_MYCLASS_::_MYCLASS_()
 
266
{
 
267
  /* member initializers and constructor code */
 
268
}
 
269
 
 
270
_MYCLASS_::~_MYCLASS_()
 
271
{
 
272
  /* destructor code */
 
273
}
 
274
 
 
275
/* attribute unsigned long algorithm; */
 
276
NS_IMETHODIMP _MYCLASS_::GetAlgorithm(PRUint32 *aAlgorithm)
 
277
{
 
278
    return NS_ERROR_NOT_IMPLEMENTED;
 
279
}
 
280
NS_IMETHODIMP _MYCLASS_::SetAlgorithm(PRUint32 aAlgorithm)
 
281
{
 
282
    return NS_ERROR_NOT_IMPLEMENTED;
 
283
}
 
284
 
 
285
/* attribute unsigned long keypairBits; */
 
286
NS_IMETHODIMP _MYCLASS_::GetKeypairBits(PRUint32 *aKeypairBits)
 
287
{
 
288
    return NS_ERROR_NOT_IMPLEMENTED;
 
289
}
 
290
NS_IMETHODIMP _MYCLASS_::SetKeypairBits(PRUint32 aKeypairBits)
 
291
{
 
292
    return NS_ERROR_NOT_IMPLEMENTED;
 
293
}
 
294
 
 
295
/* ACString encrypt (in AUTF8String clearText, in ACString symmetricKey, in ACString iv); */
 
296
NS_IMETHODIMP _MYCLASS_::Encrypt(const nsACString & clearText, const nsACString & symmetricKey, const nsACString & iv, nsACString & _retval NS_OUTPARAM)
 
297
{
 
298
    return NS_ERROR_NOT_IMPLEMENTED;
 
299
}
 
300
 
 
301
/* AUTF8String decrypt (in ACString cipherText, in ACString symmetricKey, in ACString iv); */
 
302
NS_IMETHODIMP _MYCLASS_::Decrypt(const nsACString & cipherText, const nsACString & symmetricKey, const nsACString & iv, nsACString & _retval NS_OUTPARAM)
 
303
{
 
304
    return NS_ERROR_NOT_IMPLEMENTED;
 
305
}
 
306
 
 
307
/* void generateKeypair (in ACString aPassphrase, in ACString aSalt, in ACString aIV, out ACString aEncodedPublicKey, out ACString aWrappedPrivateKey); */
 
308
NS_IMETHODIMP _MYCLASS_::GenerateKeypair(const nsACString & aPassphrase, const nsACString & aSalt, const nsACString & aIV, nsACString & aEncodedPublicKey NS_OUTPARAM, nsACString & aWrappedPrivateKey NS_OUTPARAM)
 
309
{
 
310
    return NS_ERROR_NOT_IMPLEMENTED;
 
311
}
 
312
 
 
313
/* ACString generateRandomKey (); */
 
314
NS_IMETHODIMP _MYCLASS_::GenerateRandomKey(nsACString & _retval NS_OUTPARAM)
 
315
{
 
316
    return NS_ERROR_NOT_IMPLEMENTED;
 
317
}
 
318
 
 
319
/* ACString generateRandomIV (); */
 
320
NS_IMETHODIMP _MYCLASS_::GenerateRandomIV(nsACString & _retval NS_OUTPARAM)
 
321
{
 
322
    return NS_ERROR_NOT_IMPLEMENTED;
 
323
}
 
324
 
 
325
/* ACString generateRandomBytes (in unsigned long aByteCount); */
 
326
NS_IMETHODIMP _MYCLASS_::GenerateRandomBytes(PRUint32 aByteCount, nsACString & _retval NS_OUTPARAM)
 
327
{
 
328
    return NS_ERROR_NOT_IMPLEMENTED;
 
329
}
 
330
 
 
331
/* ACString wrapSymmetricKey (in ACString aSymmetricKey, in ACString aEncodedPublicKey); */
 
332
NS_IMETHODIMP _MYCLASS_::WrapSymmetricKey(const nsACString & aSymmetricKey, const nsACString & aEncodedPublicKey, nsACString & _retval NS_OUTPARAM)
 
333
{
 
334
    return NS_ERROR_NOT_IMPLEMENTED;
 
335
}
 
336
 
 
337
/* ACString unwrapSymmetricKey (in ACString aWrappedSymmetricKey, in ACString aWrappedPrivateKey, in ACString aPassphrase, in ACString aSalt, in ACString aIV); */
 
338
NS_IMETHODIMP _MYCLASS_::UnwrapSymmetricKey(const nsACString & aWrappedSymmetricKey, const nsACString & aWrappedPrivateKey, const nsACString & aPassphrase, const nsACString & aSalt, const nsACString & aIV, nsACString & _retval NS_OUTPARAM)
 
339
{
 
340
    return NS_ERROR_NOT_IMPLEMENTED;
 
341
}
 
342
 
 
343
/* ACString rewrapPrivateKey (in ACString aWrappedPrivateKey, in ACString aPassphrase, in ACString aSalt, in ACString aIV, in ACString aNewPassphrase); */
 
344
NS_IMETHODIMP _MYCLASS_::RewrapPrivateKey(const nsACString & aWrappedPrivateKey, const nsACString & aPassphrase, const nsACString & aSalt, const nsACString & aIV, const nsACString & aNewPassphrase, nsACString & _retval NS_OUTPARAM)
 
345
{
 
346
    return NS_ERROR_NOT_IMPLEMENTED;
 
347
}
 
348
 
 
349
/* boolean verifyPassphrase (in ACString aWrappedPrivateKey, in ACString aPassphrase, in ACString aSalt, in ACString aIV); */
 
350
NS_IMETHODIMP _MYCLASS_::VerifyPassphrase(const nsACString & aWrappedPrivateKey, const nsACString & aPassphrase, const nsACString & aSalt, const nsACString & aIV, PRBool *_retval NS_OUTPARAM)
 
351
{
 
352
    return NS_ERROR_NOT_IMPLEMENTED;
 
353
}
 
354
 
 
355
/* End of implementation class template. */
 
356
#endif
 
357
 
 
358
 
 
359
#endif /* __gen_IWeaveCrypto_h__ */