10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 50Sstevel@tonic-gate * Common Development and Distribution License, Version 1.0 only 60Sstevel@tonic-gate * (the "License"). You may not use this file except in compliance 70Sstevel@tonic-gate * with the License. 80Sstevel@tonic-gate * 90Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 100Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 110Sstevel@tonic-gate * See the License for the specific language governing permissions 120Sstevel@tonic-gate * and limitations under the License. 130Sstevel@tonic-gate * 140Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 150Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 160Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 170Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 180Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 190Sstevel@tonic-gate * 200Sstevel@tonic-gate * CDDL HEADER END 210Sstevel@tonic-gate */ 220Sstevel@tonic-gate /* 230Sstevel@tonic-gate * ident "%Z%%M% %I% %E% SMI" 240Sstevel@tonic-gate * 25*96Ssemery * Copyright 2005 Sun Microsystems, Inc. All rights reserved. 26*96Ssemery * Use is subject to license terms. 270Sstevel@tonic-gate */ 280Sstevel@tonic-gate 290Sstevel@tonic-gate public class Kadmin { 300Sstevel@tonic-gate 310Sstevel@tonic-gate /** 320Sstevel@tonic-gate * Static block to load "libkadmin.so" 330Sstevel@tonic-gate */ 340Sstevel@tonic-gate static { System.loadLibrary("kadmin"); } 350Sstevel@tonic-gate 360Sstevel@tonic-gate /** 370Sstevel@tonic-gate * Initialize the kadmin session with the passed arguments 380Sstevel@tonic-gate */ sessionInit(String name, String password, String realm, String server, int port)390Sstevel@tonic-gate public native boolean sessionInit(String name, String password, 400Sstevel@tonic-gate String realm, String server, int port); 410Sstevel@tonic-gate 420Sstevel@tonic-gate /** 430Sstevel@tonic-gate * Terminate the kadmin session gracefully 440Sstevel@tonic-gate */ sessionExit()450Sstevel@tonic-gate public native void sessionExit(); 460Sstevel@tonic-gate 470Sstevel@tonic-gate /** 480Sstevel@tonic-gate * Get the ACL setting for the logged in principal 490Sstevel@tonic-gate */ getPrivs()500Sstevel@tonic-gate public native int getPrivs(); 510Sstevel@tonic-gate 520Sstevel@tonic-gate /** 53*96Ssemery * Get the complete enc type list 54*96Ssemery */ getEncList()55*96Ssemery public native String[] getEncList(); 56*96Ssemery 57*96Ssemery /** 580Sstevel@tonic-gate * Get the complete principal list 590Sstevel@tonic-gate */ getPrincipalList()600Sstevel@tonic-gate public native String[] getPrincipalList(); 610Sstevel@tonic-gate 620Sstevel@tonic-gate /** 630Sstevel@tonic-gate * Get the complete principal list in one string 640Sstevel@tonic-gate */ getPrincipalList2()650Sstevel@tonic-gate public native String getPrincipalList2(); 660Sstevel@tonic-gate 670Sstevel@tonic-gate /** 680Sstevel@tonic-gate * Load the selected principal 690Sstevel@tonic-gate */ loadPrincipal(String name, Principal p)700Sstevel@tonic-gate public native boolean loadPrincipal(String name, Principal p); 710Sstevel@tonic-gate 720Sstevel@tonic-gate /** 730Sstevel@tonic-gate * Save the selected principal 740Sstevel@tonic-gate */ savePrincipal(Principal p)750Sstevel@tonic-gate public native boolean savePrincipal(Principal p); 760Sstevel@tonic-gate 770Sstevel@tonic-gate /** 780Sstevel@tonic-gate * Create a new principal 790Sstevel@tonic-gate */ createPrincipal(Principal p)800Sstevel@tonic-gate public native boolean createPrincipal(Principal p); 810Sstevel@tonic-gate 820Sstevel@tonic-gate /** 830Sstevel@tonic-gate * Delete the selected principal 840Sstevel@tonic-gate */ deletePrincipal(String name)850Sstevel@tonic-gate public native boolean deletePrincipal(String name); 860Sstevel@tonic-gate 870Sstevel@tonic-gate /** 880Sstevel@tonic-gate * Get the complete policy list 890Sstevel@tonic-gate */ getPolicyList()900Sstevel@tonic-gate public native String[] getPolicyList(); 910Sstevel@tonic-gate 920Sstevel@tonic-gate /** 930Sstevel@tonic-gate * Load the selected policy 940Sstevel@tonic-gate */ loadPolicy(String name, Policy p)950Sstevel@tonic-gate public native boolean loadPolicy(String name, Policy p); 960Sstevel@tonic-gate 970Sstevel@tonic-gate /** 980Sstevel@tonic-gate * Save the selected policy 990Sstevel@tonic-gate */ savePolicy(Policy p)1000Sstevel@tonic-gate public native boolean savePolicy(Policy p); 1010Sstevel@tonic-gate 1020Sstevel@tonic-gate /** 1030Sstevel@tonic-gate * Create a new policy 1040Sstevel@tonic-gate */ createPolicy(Policy p)1050Sstevel@tonic-gate public native boolean createPolicy(Policy p); 1060Sstevel@tonic-gate 1070Sstevel@tonic-gate /** 1080Sstevel@tonic-gate * Delete the selected policy 1090Sstevel@tonic-gate */ deletePolicy(String name)1100Sstevel@tonic-gate public native boolean deletePolicy(String name); 1110Sstevel@tonic-gate } 112