01: /*
02: * @(#)init.java 1.3 05/01/14
03: *
04: * Copyright (c) 2001-2004 Sun Microsystems, Inc. All Rights Reserved.
05: *
06: * See the file "LICENSE.txt" for information on usage and redistribution
07: * of this file, and for a DISCLAIMER OF ALL WARRANTIES.
08: */
09: package pnuts.security;
10:
11: import pnuts.lang.Context;
12: import pnuts.ext.ModuleBase;
13:
14: /**
15: * Initialization of the pnuts.security module
16: */
17: public class init extends ModuleBase {
18:
19: static String[] files = { "pnuts/security/security",
20: "pnuts/security/cipher", "pnuts/security/digest",
21: "pnuts/security/permission", };
22:
23: static String[][] functions = { { // pnuts/util/security
24: "getKeyStore", "getPublicKey", "getPrivateKey",
25: "signObject", "verifyObject" }, { // pnuts/util/cipher
26: "getSecretKey", "encrypt", "decrypt", "sealObject",
27: "unsealObject" }, { // pnuts/util/digest
28: "md5", "sha" }, { "permissions", "secureFunc" } };
29:
30: static String[] requiredModules = { "pnuts.io", "pnuts.lib" };
31:
32: protected String[] getRequiredModules() {
33: return requiredModules;
34: }
35:
36: public Object execute(Context context) {
37: for (int i = 0; i < files.length; i++) {
38: autoload(functions[i], files[i], context);
39: }
40: return null;
41: }
42: }
|