/* class Win32CertManager starts the win32 cryptoAPI certificate manager by invoking "rundll32.exe cryptui.dll,CryptUIStartCertMgr" Code for Netscape or Microsoft JVM. M. Gallant 04/08/2002 */ import com.ms.security.*; import java.awt.*; import java.awt.event.*; import java.applet.*; import java.io.* ; import java.util.*; import netscape.security.PrivilegeManager; public class Win32CertManager extends Applet implements ActionListener { private Button startbutton = new Button("Start CryptoAPI Certificate Manager") ; private static final String execommand = "rundll32.exe cryptui.dll,CryptUIStartCertMgr" ; public void init() { try { if (Class.forName("com.ms.security.PolicyEngine") != null) { // required for IE PolicyEngine.assertPermission(PermissionID.SYSTEM); } } catch (Throwable cnfe) { } try{ PrivilegeManager.enablePrivilege("UniversalExecAccess") ; // required for NN } catch(Exception cnfe) { System.out.println("netscape.security.PrivilegeManager class not found") ; } if(System.getProperty("os.name").equals("Windows NT") || System.getProperty("os.name").equals("Windows 2000") || System.getProperty("os.name").equals("Windows XP") ) // if NT, Win2000 or WinXP ... ; this.setBackground(Color.white) ; startbutton.addActionListener(this) ; add(startbutton) ; startbutton.setBackground(Color.blue) ; startbutton.setForeground(Color.yellow) ; Font f = new Font("TimesRoman", Font.PLAIN, 16); FontMetrics fm = getFontMetrics(f); setFont(f) ; } public void actionPerformed(ActionEvent e) { if( e.getSource() == startbutton) { try{ PrivilegeManager.enablePrivilege("UniversalExecAccess") ; // required for NN } catch(Exception cnfe) { System.out.println("netscape.security.PrivilegeManager class not found") ; } try { Process proc = Runtime.getRuntime().exec(execommand) ; } catch(IOException ieo) { System.out.println("Problem starting " + execommand) ; } } } }