xref: /titanic_44/usr/src/cmd/krb5/kadmin/gui/native/Kadmin.java (revision bc913c4cbc9594e8ca0a031ba908f496ef40bbca)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * ident	"%Z%%M%	%I%	%E% SMI"
24  *
25  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
26  * Use is subject to license terms.
27  */
28 
29 public class Kadmin {
30 
31 	/**
32 	 * Static block to load "libkadmin.so"
33 	 */
34 	static { System.loadLibrary("kadmin"); }
35 
36 	/**
37 	 * Initialize the kadmin session with the passed arguments
38 	 */
39 	public native boolean sessionInit(String name, String password,
40 		String realm, String server, int port);
41 
42 	/**
43 	 * Terminate the kadmin session gracefully
44 	 */
45 	public native void sessionExit();
46 
47 	/**
48 	 * Get the ACL setting for the logged in principal
49 	 */
50 	public native int getPrivs();
51 
52 	/**
53 	 * Get the complete enc type list
54 	 */
55 	public native String[] getEncList();
56 
57 	/**
58 	 * Get the complete principal list
59 	 */
60 	public native String[] getPrincipalList();
61 
62 	/**
63 	 * Get the complete principal list in one string
64 	 */
65 	public native String getPrincipalList2();
66 
67 	/**
68 	 * Load the selected principal
69 	 */
70 	public native boolean loadPrincipal(String name, Principal p);
71 
72 	/**
73 	 * Save the selected principal
74 	 */
75 	public native boolean savePrincipal(Principal p);
76 
77 	/**
78 	 * Create a new principal
79 	 */
80 	public native boolean createPrincipal(Principal p);
81 
82 	/**
83 	 * Delete the selected principal
84 	 */
85 	public native boolean deletePrincipal(String name);
86 
87 	/**
88 	 * Get the complete policy list
89 	 */
90 	public native String[] getPolicyList();
91 
92 	/**
93 	 * Load the selected policy
94 	 */
95 	public native boolean loadPolicy(String name, Policy p);
96 
97 	/**
98 	 * Save the selected policy
99 	 */
100 	public native boolean savePolicy(Policy p);
101 
102 	/**
103 	 * Create a new policy
104 	 */
105 	public native boolean createPolicy(Policy p);
106 
107 	/**
108 	 * Delete the selected policy
109 	 */
110 	public native boolean deletePolicy(String name);
111 }
112