security/manager/ssl/public/nsIKeyModule.idl

branch
TOR_BUG_9701
changeset 15
b8a032363ba2
equal deleted inserted replaced
-1:000000000000 0:6bbd37d6f815
1 /* This Source Code Form is subject to the terms of the Mozilla Public
2 * License, v. 2.0. If a copy of the MPL was not distributed with this
3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4
5 #include "nsISupports.idl"
6
7 // An opaque key object.
8 [scriptable, uuid(4b31f4ed-9424-4710-b946-79b7e33cf3a8)]
9 interface nsIKeyObject : nsISupports
10 {
11 // Key types
12 const short SYM_KEY = 1;
13 const short PRIVATE_KEY = 2;
14 const short PUBLIC_KEY = 3;
15
16 // Algorithm types
17 const short RC4 = 1;
18 const short AES_CBC = 2;
19 const short HMAC = 257;
20
21 // aAlgorithm is an algorithm type
22 // aKey is either a PK11SymKey, SECKEYPublicKey, or a SECKEYPrivateKey.
23 // The nsIKeyObject will take ownership of the key and be responsible
24 // for freeing the key memory when destroyed.
25 [noscript] void initKey(in short aAlgorithm, in voidPtr aKey);
26
27 // Return a pointer to the underlying key object
28 [noscript] voidPtr getKeyObj();
29
30 // Will return NS_ERROR_NOT_INITIALIZED if initKey hasn't been run
31 short getType();
32 };
33
34 [scriptable, uuid(264eb54d-e20d-49a0-890c-1a5986ea81c4)]
35 interface nsIKeyObjectFactory : nsISupports
36 {
37 nsIKeyObject lookupKeyByName(in ACString aName);
38
39 nsIKeyObject unwrapKey(in short aAlgorithm,
40 [const, array, size_is(aWrappedKeyLen)] in octet aWrappedKey,
41 in unsigned long aWrappedKeyLen);
42
43 // TODO: deriveKeyFrom*
44
45
46 // DO NOT USE
47 // This is not FIPS compliant and should not be used.
48 nsIKeyObject keyFromString(in short aAlgorithm, in ACString aKey);
49 };

mercurial