xref: /titanic_41/usr/src/cmd/krb5/kadmin/gui/native/Kadmin.java (revision 45526e9775395f5d44bad3f5430041f32c84ce1e)
17c478bd9Sstevel@tonic-gate /*
27c478bd9Sstevel@tonic-gate  * CDDL HEADER START
37c478bd9Sstevel@tonic-gate  *
47c478bd9Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
57c478bd9Sstevel@tonic-gate  * Common Development and Distribution License, Version 1.0 only
67c478bd9Sstevel@tonic-gate  * (the "License").  You may not use this file except in compliance
77c478bd9Sstevel@tonic-gate  * with the License.
87c478bd9Sstevel@tonic-gate  *
97c478bd9Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
107c478bd9Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
117c478bd9Sstevel@tonic-gate  * See the License for the specific language governing permissions
127c478bd9Sstevel@tonic-gate  * and limitations under the License.
137c478bd9Sstevel@tonic-gate  *
147c478bd9Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
157c478bd9Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
167c478bd9Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
177c478bd9Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
187c478bd9Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
197c478bd9Sstevel@tonic-gate  *
207c478bd9Sstevel@tonic-gate  * CDDL HEADER END
217c478bd9Sstevel@tonic-gate  */
227c478bd9Sstevel@tonic-gate /*
237c478bd9Sstevel@tonic-gate  * ident	"%Z%%M%	%I%	%E% SMI"
247c478bd9Sstevel@tonic-gate  *
25*45526e97Ssemery  * Copyright 2005 Sun Microsystems, Inc.  All rights reserved.
26*45526e97Ssemery  * Use is subject to license terms.
277c478bd9Sstevel@tonic-gate  */
287c478bd9Sstevel@tonic-gate 
297c478bd9Sstevel@tonic-gate public class Kadmin {
307c478bd9Sstevel@tonic-gate 
317c478bd9Sstevel@tonic-gate 	/**
327c478bd9Sstevel@tonic-gate 	 * Static block to load "libkadmin.so"
337c478bd9Sstevel@tonic-gate 	 */
347c478bd9Sstevel@tonic-gate 	static { System.loadLibrary("kadmin"); }
357c478bd9Sstevel@tonic-gate 
367c478bd9Sstevel@tonic-gate 	/**
377c478bd9Sstevel@tonic-gate 	 * Initialize the kadmin session with the passed arguments
387c478bd9Sstevel@tonic-gate 	 */
sessionInit(String name, String password, String realm, String server, int port)397c478bd9Sstevel@tonic-gate 	public native boolean sessionInit(String name, String password,
407c478bd9Sstevel@tonic-gate 		String realm, String server, int port);
417c478bd9Sstevel@tonic-gate 
427c478bd9Sstevel@tonic-gate 	/**
437c478bd9Sstevel@tonic-gate 	 * Terminate the kadmin session gracefully
447c478bd9Sstevel@tonic-gate 	 */
sessionExit()457c478bd9Sstevel@tonic-gate 	public native void sessionExit();
467c478bd9Sstevel@tonic-gate 
477c478bd9Sstevel@tonic-gate 	/**
487c478bd9Sstevel@tonic-gate 	 * Get the ACL setting for the logged in principal
497c478bd9Sstevel@tonic-gate 	 */
getPrivs()507c478bd9Sstevel@tonic-gate 	public native int getPrivs();
517c478bd9Sstevel@tonic-gate 
527c478bd9Sstevel@tonic-gate 	/**
53*45526e97Ssemery 	 * Get the complete enc type list
54*45526e97Ssemery 	 */
getEncList()55*45526e97Ssemery 	public native String[] getEncList();
56*45526e97Ssemery 
57*45526e97Ssemery 	/**
587c478bd9Sstevel@tonic-gate 	 * Get the complete principal list
597c478bd9Sstevel@tonic-gate 	 */
getPrincipalList()607c478bd9Sstevel@tonic-gate 	public native String[] getPrincipalList();
617c478bd9Sstevel@tonic-gate 
627c478bd9Sstevel@tonic-gate 	/**
637c478bd9Sstevel@tonic-gate 	 * Get the complete principal list in one string
647c478bd9Sstevel@tonic-gate 	 */
getPrincipalList2()657c478bd9Sstevel@tonic-gate 	public native String getPrincipalList2();
667c478bd9Sstevel@tonic-gate 
677c478bd9Sstevel@tonic-gate 	/**
687c478bd9Sstevel@tonic-gate 	 * Load the selected principal
697c478bd9Sstevel@tonic-gate 	 */
loadPrincipal(String name, Principal p)707c478bd9Sstevel@tonic-gate 	public native boolean loadPrincipal(String name, Principal p);
717c478bd9Sstevel@tonic-gate 
727c478bd9Sstevel@tonic-gate 	/**
737c478bd9Sstevel@tonic-gate 	 * Save the selected principal
747c478bd9Sstevel@tonic-gate 	 */
savePrincipal(Principal p)757c478bd9Sstevel@tonic-gate 	public native boolean savePrincipal(Principal p);
767c478bd9Sstevel@tonic-gate 
777c478bd9Sstevel@tonic-gate 	/**
787c478bd9Sstevel@tonic-gate 	 * Create a new principal
797c478bd9Sstevel@tonic-gate 	 */
createPrincipal(Principal p)807c478bd9Sstevel@tonic-gate 	public native boolean createPrincipal(Principal p);
817c478bd9Sstevel@tonic-gate 
827c478bd9Sstevel@tonic-gate 	/**
837c478bd9Sstevel@tonic-gate 	 * Delete the selected principal
847c478bd9Sstevel@tonic-gate 	 */
deletePrincipal(String name)857c478bd9Sstevel@tonic-gate 	public native boolean deletePrincipal(String name);
867c478bd9Sstevel@tonic-gate 
877c478bd9Sstevel@tonic-gate 	/**
887c478bd9Sstevel@tonic-gate 	 * Get the complete policy list
897c478bd9Sstevel@tonic-gate 	 */
getPolicyList()907c478bd9Sstevel@tonic-gate 	public native String[] getPolicyList();
917c478bd9Sstevel@tonic-gate 
927c478bd9Sstevel@tonic-gate 	/**
937c478bd9Sstevel@tonic-gate 	 * Load the selected policy
947c478bd9Sstevel@tonic-gate 	 */
loadPolicy(String name, Policy p)957c478bd9Sstevel@tonic-gate 	public native boolean loadPolicy(String name, Policy p);
967c478bd9Sstevel@tonic-gate 
977c478bd9Sstevel@tonic-gate 	/**
987c478bd9Sstevel@tonic-gate 	 * Save the selected policy
997c478bd9Sstevel@tonic-gate 	 */
savePolicy(Policy p)1007c478bd9Sstevel@tonic-gate 	public native boolean savePolicy(Policy p);
1017c478bd9Sstevel@tonic-gate 
1027c478bd9Sstevel@tonic-gate 	/**
1037c478bd9Sstevel@tonic-gate 	 * Create a new policy
1047c478bd9Sstevel@tonic-gate 	 */
createPolicy(Policy p)1057c478bd9Sstevel@tonic-gate 	public native boolean createPolicy(Policy p);
1067c478bd9Sstevel@tonic-gate 
1077c478bd9Sstevel@tonic-gate 	/**
1087c478bd9Sstevel@tonic-gate 	 * Delete the selected policy
1097c478bd9Sstevel@tonic-gate 	 */
deletePolicy(String name)1107c478bd9Sstevel@tonic-gate 	public native boolean deletePolicy(String name);
1117c478bd9Sstevel@tonic-gate }
112