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 (c) 2001 by Sun Microsystems, Inc. 26 * All rights reserved. 27 */ 28 29 //import Principal; 30 //import Policy; 31 32 public class Kadmin { 33 34 /** 35 * Static block to load "libkadmin.so" 36 */ 37 static { System.loadLibrary("kadmin"); } 38 39 /** 40 * Initialize the kadmin session with the passed arguments 41 */ 42 public native boolean sessionInit(String name, String password, 43 String realm, String server, int port); 44 45 /** 46 * Terminate the kadmin session gracefully 47 */ 48 public native void sessionExit(); 49 50 /** 51 * Get the ACL setting for the logged in principal 52 */ 53 public native int getPrivs(); 54 55 /** 56 * Get the complete principal list 57 */ 58 public native String[] getPrincipalList(); 59 60 /** 61 * Get the complete principal list in one string 62 */ 63 public native String getPrincipalList2(); 64 65 /** 66 * Load the selected principal 67 */ 68 public native boolean loadPrincipal(String name, Principal p); 69 70 /** 71 * Save the selected principal 72 */ 73 public native boolean savePrincipal(Principal p); 74 75 /** 76 * Create a new principal 77 */ 78 public native boolean createPrincipal(Principal p); 79 80 /** 81 * Delete the selected principal 82 */ 83 public native boolean deletePrincipal(String name); 84 85 /** 86 * Get the complete policy list 87 */ 88 public native String[] getPolicyList(); 89 90 /** 91 * Load the selected policy 92 */ 93 public native boolean loadPolicy(String name, Policy p); 94 95 /** 96 * Save the selected policy 97 */ 98 public native boolean savePolicy(Policy p); 99 100 /** 101 * Create a new policy 102 */ 103 public native boolean createPolicy(Policy p); 104 105 /** 106 * Delete the selected policy 107 */ 108 public native boolean deletePolicy(String name); 109 } 110