当前位置: 首页>>代码示例>>Java>>正文


Java AuthProvider类代码示例

本文整理汇总了Java中java.security.AuthProvider的典型用法代码示例。如果您正苦于以下问题:Java AuthProvider类的具体用法?Java AuthProvider怎么用?Java AuthProvider使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


AuthProvider类属于java.security包,在下文中一共展示了AuthProvider类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: clear

import java.security.AuthProvider; //导入依赖的package包/类
private void clear() throws LoginException {
    LoginModuleUtils.clearPassword(keyStorePassword);
    keyStorePassword = null;
    LoginModuleUtils.clearPassword(privateKeyPassword);
    privateKeyPassword = null;
    
    if (keyStoreProvider instanceof AuthProvider) {
        ((AuthProvider) (keyStoreProvider)).logout();
    }
    
    if (principal != null) {
        subject.getPrincipals().remove(principal);
        principal = null;
    }
    if (certPath != null) {
        subject.getPublicCredentials().remove(certPath);
        certPath = null;
    }
    if (privateCredential != null) {
        subject.getPrivateCredentials().remove(privateCredential);
        privateCredential.destroy();
        privateCredential = null;
    }
    status.logouted();
}
 
开发者ID:shannah,项目名称:cn1,代码行数:26,代码来源:KeyStoreLoginModule.java

示例2: list

import java.security.AuthProvider; //导入依赖的package包/类
private static void list() throws Exception {
    int testnum = 1;

    ks = KeyStore.getInstance(KS_TYPE, provider);

    // check instance
    if (ks.getProvider() instanceof java.security.AuthProvider) {
        System.out.println("keystore provider instance of AuthProvider");
        System.out.println("test " + testnum++ + " passed");
    } else {
        throw new SecurityException("did not get AuthProvider KeyStore");
    }

    // load
    ks.load(null, tokenPwd);
    System.out.println("test " + testnum++ + " passed");

    // aliases
    Enumeration enu = ks.aliases();
    int count = 0;
    while (enu.hasMoreElements()) {
        count++;
        System.out.println("alias " +
                            count +
                            " = " +
                            (String)enu.nextElement());
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:29,代码来源:Basic.java

示例3: doAction

import java.security.AuthProvider; //导入依赖的package包/类
/**
 * Do action.
 */
@Override
protected void doAction() {

	try {
		DOpenPkcs11KeyStore dOpenPkcs11KeyStore = new DOpenPkcs11KeyStore(frame);
		dOpenPkcs11KeyStore.setLocationRelativeTo(frame);
		dOpenPkcs11KeyStore.setVisible(true);

		Provider selectedProvider = dOpenPkcs11KeyStore.getSelectedProvider();
		if (selectedProvider == null) {
			return;
		}

		KeyStore keyStore = KeyStore.getInstance(PKCS11.jce(), selectedProvider);

		// register password handler
		AuthProvider authProvider = (AuthProvider) selectedProvider;
		authProvider.setCallbackHandler(new PasswordCallbackHandler(frame));

		keyStore.load(null, null);

		kseFrame.addKeyStore(keyStore, selectedProvider.getName(), null, selectedProvider);

	} catch (Exception ex) {
		DError.displayError(frame, ex);
	}
}
 
开发者ID:kaikramer,项目名称:keystore-explorer,代码行数:31,代码来源:OpenPkcs11Action.java

示例4: logoutSmart

import java.security.AuthProvider; //导入依赖的package包/类
/**
 * Efetua logout do SmartCard
 * @throws LoginException 
 */
public static void logoutSmart () throws LoginException{
	if (pkcs11Provider != null){
		AuthProvider ap = (AuthProvider) pkcs11Provider;
		ap.logout();
		pkcs11Provider = null;
	}
	if (providerName != null){
		Security.removeProvider(providerName);
		providerName = null;
	}
}
 
开发者ID:esaito,项目名称:ExemplosDemoiselle,代码行数:16,代码来源:TabeliaoAppletUtil.java


注:本文中的java.security.AuthProvider类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。