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


Java Destroyable类代码示例

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


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

示例1: testNoKeyDestruction

import javax.security.auth.Destroyable; //导入依赖的package包/类
private static void testNoKeyDestruction(Destroyable key)
    throws Exception {
    String klass = key.getClass().getName();

    if (key.isDestroyed()) {
        throw new Exception("error: a " + klass +
            " key has been unexpectedly destroyed");
    }
    try {
        key.destroy();
    } catch (DestroyFailedException dfe) {
        // not an error

        if (key.isDestroyed()) {
            throw new Exception("error: a " + klass +
                " key has been unexpectedly destroyed");
        }
        System.out.println(klass + " keys are not destroyable");
        return;
    }
    throw new Exception("error: key may been unexpectedly destroyed");
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:23,代码来源:KeyDestructionTest.java

示例2: destroyKey

import javax.security.auth.Destroyable; //导入依赖的package包/类
private static void destroyKey(Key key) throws Exception {
    String klass = key.getClass().getName();

    if (!(key instanceof Destroyable)) {
        throw new UnsupportedOperationException();
    }

    Destroyable dKey = (Destroyable) key;
    if (dKey.isDestroyed()) {
        throw new Exception("error: a " + klass +
            " key has already been destroyed");
    }
    dKey.destroy();
    if (!dKey.isDestroyed()) {
        throw new Exception("error: a " + klass +
            " key has NOT been destroyed");
    }
}
 
开发者ID:campolake,项目名称:openjdk9,代码行数:19,代码来源:KeyDestructionTest.java

示例3: destroy

import javax.security.auth.Destroyable; //导入依赖的package包/类
public void destroy() throws DestroyFailedException
{
	if (this.children != null)
	{
		for (Destroyable destroyable : this.children)
		{
			if (destroyable.isDestroyed()) continue;
			
			if (destroyable instanceof DestroyableChild)
				((DestroyableChild)destroyable).unlink();
			
			destroyable.destroy();
		}
		
		this.children = null;
	}
	super.destroy();
}
 
开发者ID:CardContact,项目名称:opensc-java,代码行数:19,代码来源:DestroyableHolder.java

示例4: register

import javax.security.auth.Destroyable; //导入依赖的package包/类
public void register(Destroyable destroyable)
{
	if (this.children == null)
		this.children = new HashSet<Destroyable>();
	
	this.children.add(destroyable);
}
 
开发者ID:CardContact,项目名称:opensc-java,代码行数:8,代码来源:DestroyableHolder.java

示例5: destroy

import javax.security.auth.Destroyable; //导入依赖的package包/类
@Override
public void destroy() {
    if (key instanceof Destroyable && !((Destroyable) key).isDestroyed()) {
        try {
            ((Destroyable) key).destroy();
        } catch (DestroyFailedException e) {
            // it's too common that JCE keys aren't destroyable although they say they are
            // so won't log this to avoid spamming logs
        }
    }
}
 
开发者ID:Kloudtek,项目名称:kryptotek-core,代码行数:12,代码来源:AbstractJCEKey.java

示例6: deregister

import javax.security.auth.Destroyable; //导入依赖的package包/类
public void deregister(Destroyable destroyable)
{
	if (this.children == null) return;
	
	this.children.remove(destroyable);
}
 
开发者ID:CardContact,项目名称:opensc-java,代码行数:7,代码来源:DestroyableHolder.java

示例7: register

import javax.security.auth.Destroyable; //导入依赖的package包/类
public void register(Destroyable destroyable)
{
	this.destroyableHolder.register(destroyable);
}
 
开发者ID:CardContact,项目名称:opensc-java,代码行数:5,代码来源:PKCS11Provider.java

示例8: deregister

import javax.security.auth.Destroyable; //导入依赖的package包/类
public void deregister(Destroyable destroyable)
{
	this.destroyableHolder.deregister(destroyable);
}
 
开发者ID:CardContact,项目名称:opensc-java,代码行数:5,代码来源:PKCS11Provider.java

示例9: register

import javax.security.auth.Destroyable; //导入依赖的package包/类
/**
 * Register a Destroyable for recursive destruction.
 * 
 * @param destroyable The child to be registered.
 */
public void register(Destroyable destroyable);
 
开发者ID:CardContact,项目名称:opensc-java,代码行数:7,代码来源:DestroyableParent.java

示例10: deregister

import javax.security.auth.Destroyable; //导入依赖的package包/类
/**
 * Deregister a Destroyable from recursive destruction.
 * 
 * @param destroyable The child to be deregistered.
 */
public void deregister(Destroyable destroyable);
 
开发者ID:CardContact,项目名称:opensc-java,代码行数:7,代码来源:DestroyableParent.java


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