• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java SSLPermission类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: getSessionContext

import javax.net.ssl.SSLPermission; //导入依赖的package包/类
/**
 * For server sessions, this returns the set of sessions which
 * are currently valid in this process.  For client sessions,
 * this returns null.
 */
@Override
public SSLSessionContext getSessionContext() {
    /*
     * An interim security policy until we can do something
     * more specific in 1.2. Only allow trusted code (code which
     * can set system properties) to get an
     * SSLSessionContext. This is to limit the ability of code to
     * look up specific sessions or enumerate over them. Otherwise,
     * code can only get session objects from successful SSL
     * connections which implies that they must have had permission
     * to make the network connection in the first place.
     */
    SecurityManager sm;
    if ((sm = System.getSecurityManager()) != null) {
        sm.checkPermission(new SSLPermission("getSSLSessionContext"));
    }

    return context;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:25,代码来源:SSLSessionImpl.java


示例2: getSessionContext

import javax.net.ssl.SSLPermission; //导入依赖的package包/类
/**
 * For server sessions, this returns the set of sessions which
 * are currently valid in this process.  For client sessions,
 * this returns null.
 */
public SSLSessionContext getSessionContext() {
    /*
     * An interim security policy until we can do something
     * more specific in 1.2. Only allow trusted code (code which
     * can set system properties) to get an
     * SSLSessionContext. This is to limit the ability of code to
     * look up specific sessions or enumerate over them. Otherwise,
     * code can only get session objects from successful SSL
     * connections which implies that they must have had permission
     * to make the network connection in the first place.
     */
    SecurityManager sm;
    if ((sm = System.getSecurityManager()) != null) {
        sm.checkPermission(new SSLPermission("getSSLSessionContext"));
    }

    return context;
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:24,代码来源:SSLSessionImpl.java


示例3: if

import javax.net.ssl.SSLPermission; //导入依赖的package包/类
/**
 * Reconfigure this instance to use a different session context
 * implementation.
 *
 * <p><strong>Note:</strong> this method requires that the caller have
 * {@link SSLPermission} with target
 * <code>gnu.javax.net.ssl.AbstractSessionContext</code> and action
 * <code>setImplClass</code>.
 *
 * @param clazz The new implementation class.
 * @throws SecurityException If the caller does not have permission to
 *  change the session context.
 */
@Requires(permissionClass = SSLPermission.class,
          target = "gnu.javax.net.ssl.AbstractSessionContext",
          action = "setImplClass")
public static synchronized void setImplClass
  (Class<? extends AbstractSessionContext> clazz)
  throws SecurityException
{
  SecurityManager sm = System.getSecurityManager ();
  if (sm != null)
    sm.checkPermission(new SSLPermission("gnu.javax.net.ssl.AbstractSessionContext",
                                         "setImplClass"));
  implClass = clazz;
}
 
开发者ID:vilie,项目名称:javify,代码行数:27,代码来源:AbstractSessionContext.java


示例4: if

import javax.net.ssl.SSLPermission; //导入依赖的package包/类
/**
 * Reconfigure this instance to use a different session context
 * implementation.
 * 
 * <p><strong>Note:</strong> this method requires that the caller have
 * {@link SSLPermission} with target
 * <code>gnu.javax.net.ssl.AbstractSessionContext</code> and action
 * <code>setImplClass</code>.
 * 
 * @param clazz The new implementation class.
 * @throws SecurityException If the caller does not have permission to
 *  change the session context.
 */
@Requires(permissionClass = SSLPermission.class,
          target = "gnu.javax.net.ssl.AbstractSessionContext",
          action = "setImplClass")
public static synchronized void setImplClass
  (Class<? extends AbstractSessionContext> clazz)
  throws SecurityException
{
  SecurityManager sm = System.getSecurityManager ();
  if (sm != null)
    sm.checkPermission(new SSLPermission("gnu.javax.net.ssl.AbstractSessionContext",
                                         "setImplClass"));
  implClass = clazz;
}
 
开发者ID:nmldiegues,项目名称:jvm-stm,代码行数:27,代码来源:AbstractSessionContext.java


示例5: checkSSLPermission

import javax.net.ssl.SSLPermission; //导入依赖的package包/类
protected boolean checkSSLPermission(SSLPermission perm) {
	String name = perm.getName();

	if (name.equals("getSSLSessionContext")) {
		return true;
	}

	/*
	 * setHostnameVerifier, setDefaultSSLContext
	 */
	return false;
}
 
开发者ID:EvoSuite,项目名称:evosuite,代码行数:13,代码来源:MSecurityManager.java


示例6: getSessionContext

import javax.net.ssl.SSLPermission; //导入依赖的package包/类
public SSLSessionContext getSessionContext() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SSLPermission("getSSLSessionContext"));
    }
    return context;
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:8,代码来源:SSLSessionImpl.java


示例7: getSessionContext

import javax.net.ssl.SSLPermission; //导入依赖的package包/类
/**
 * @see javax.net.ssl.SSLSession.getSessionContext()
 */
public SSLSessionContext getSessionContext() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SSLPermission("getSSLSessionContext"));
    }
    return context;
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:11,代码来源:SSLSessionImpl.java


示例8: getOnosPermission

import javax.net.ssl.SSLPermission; //导入依赖的package包/类
public static org.onosproject.security.Permission getOnosPermission(Permission permission) {
    if (permission instanceof AppPermission) {
        return new org.onosproject.security.Permission(AppPermission.class.getName(), permission.getName(), "");
    } else if (permission instanceof FilePermission) {
        return new org.onosproject.security.Permission(
                FilePermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof SerializablePermission) {
        return new org.onosproject.security.Permission(
                SerializablePermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof NetPermission) {
        return new org.onosproject.security.Permission(
                NetPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof RuntimePermission) {
        return new org.onosproject.security.Permission(
                RuntimePermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof SocketPermission) {
        return new org.onosproject.security.Permission(
                SocketPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof SQLPermission) {
        return new org.onosproject.security.Permission(
                SQLPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof PropertyPermission) {
        return new org.onosproject.security.Permission(
                PropertyPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof LoggingPermission) {
        return new org.onosproject.security.Permission(
                LoggingPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof SSLPermission) {
        return new org.onosproject.security.Permission(
                SSLPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof AuthPermission) {
        return new org.onosproject.security.Permission(
                AuthPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof PrivateCredentialPermission) {
        return new org.onosproject.security.Permission(
                PrivateCredentialPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof DelegationPermission) {
        return new org.onosproject.security.Permission(
                DelegationPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof javax.security.auth.kerberos.ServicePermission) {
        return new org.onosproject.security.Permission(
                javax.security.auth.kerberos.ServicePermission.class.getName(), permission.getName(),
                permission.getActions());
    } else if (permission instanceof AudioPermission) {
        return new org.onosproject.security.Permission(
                AudioPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof AdaptPermission) {
        return new org.onosproject.security.Permission(
                AdaptPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof BundlePermission) {
        return new org.onosproject.security.Permission(
                BundlePermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof CapabilityPermission) {
        return new org.onosproject.security.Permission(
                CapabilityPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof PackagePermission) {
        return new org.onosproject.security.Permission(
                PackagePermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof ServicePermission) {
        return new org.onosproject.security.Permission(
                ServicePermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof AdminPermission) {
        return new org.onosproject.security.Permission(
                AdminPermission.class.getName(), permission.getName(), permission.getActions());
    } else if (permission instanceof ConfigurationPermission) {
        return new org.onosproject.security.Permission(
                ConfigurationPermission.class.getName(), permission.getName(), permission.getActions());
    }
    return null;
}
 
开发者ID:shlee89,项目名称:athena,代码行数:71,代码来源:DefaultPolicyBuilder.java


示例9: getPermission

import javax.net.ssl.SSLPermission; //导入依赖的package包/类
private static Permission getPermission(org.onosproject.security.Permission permission) {

        String classname = permission.getClassName();
        String name = permission.getName();
        String actions = permission.getActions();

        if (classname == null || name == null) {
            return null;
        }
        classname = classname.trim();
        name = name.trim();
        actions = actions.trim();

        if (AppPermission.class.getName().equals(classname)) {
            return new AppPermission(name);
        } else if (FilePermission.class.getName().equals(classname)) {
            return new FilePermission(name, actions);
        } else if (SerializablePermission.class.getName().equals(classname)) {
            return new SerializablePermission(name, actions);
        } else if (NetPermission.class.getName().equals(classname)) {
            return new NetPermission(name, actions);
        } else if (RuntimePermission.class.getName().equals(classname)) {
            return new RuntimePermission(name, actions);
        } else if (SocketPermission.class.getName().equals(classname)) {
            return new SocketPermission(name, actions);
        } else if (SQLPermission.class.getName().equals(classname)) {
            return new SQLPermission(name, actions);
        } else if (PropertyPermission.class.getName().equals(classname)) {
            return new PropertyPermission(name, actions);
        } else if (LoggingPermission.class.getName().equals(classname)) {
            return new LoggingPermission(name, actions);
        } else if (SSLPermission.class.getName().equals(classname)) {
            return new SSLPermission(name, actions);
        } else if (AuthPermission.class.getName().equals(classname)) {
            return new AuthPermission(name, actions);
        } else if (PrivateCredentialPermission.class.getName().equals(classname)) {
            return new PrivateCredentialPermission(name, actions);
        } else if (DelegationPermission.class.getName().equals(classname)) {
            return new DelegationPermission(name, actions);
        } else if (javax.security.auth.kerberos.ServicePermission.class.getName().equals(classname)) {
            return new javax.security.auth.kerberos.ServicePermission(name, actions);
        } else if (AudioPermission.class.getName().equals(classname)) {
            return new AudioPermission(name, actions);
        } else if (AdaptPermission.class.getName().equals(classname)) {
            return new AdaptPermission(name, actions);
        } else if (BundlePermission.class.getName().equals(classname)) {
            return new BundlePermission(name, actions);
        } else if (CapabilityPermission.class.getName().equals(classname)) {
            return new CapabilityPermission(name, actions);
        } else if (PackagePermission.class.getName().equals(classname)) {
            return new PackagePermission(name, actions);
        } else if (ServicePermission.class.getName().equals(classname)) {
            return new ServicePermission(name, actions);
        } else if (AdminPermission.class.getName().equals(classname)) {
            return new AdminPermission(name, actions);
        } else if (ConfigurationPermission.class.getName().equals(classname)) {
            return new ConfigurationPermission(name, actions);
        } else if (ReflectPermission.class.getName().equals(classname)) {
            return new ReflectPermission(name, actions);
        }

        //AllPermission, SecurityPermission, UnresolvedPermission
        //AWTPermission,  ReflectPermission not allowed
        return null;

    }
 
开发者ID:shlee89,项目名称:athena,代码行数:67,代码来源:DefaultPolicyBuilder.java


示例10: testSSLPermissionString

import javax.net.ssl.SSLPermission; //导入依赖的package包/类
public void testSSLPermissionString() {
   new SSLPermission("name");
}
 
开发者ID:shannah,项目名称:cn1,代码行数:4,代码来源:SSLPermissionTest.java


示例11: testSSLPermissionStringString

import javax.net.ssl.SSLPermission; //导入依赖的package包/类
public void testSSLPermissionStringString() {
    new SSLPermission("name", "action");
}
 
开发者ID:shannah,项目名称:cn1,代码行数:4,代码来源:SSLPermissionTest.java


示例12: testSSLPermissionString

import javax.net.ssl.SSLPermission; //导入依赖的package包/类
public void testSSLPermissionString() {
    SSLPermission p = new SSLPermission("name");
    if (p == null) {
        fail("null permission");
    }
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:7,代码来源:SSLPermissionTest.java


示例13: testSSLPermissionStringString

import javax.net.ssl.SSLPermission; //导入依赖的package包/类
public void testSSLPermissionStringString() {
    SSLPermission p = new SSLPermission("name", "action");
    if (p == null) {
        fail("null permission");
    }
}
 
开发者ID:freeVM,项目名称:freeVM,代码行数:7,代码来源:SSLPermissionTest.java


示例14: getSessionContext

import javax.net.ssl.SSLPermission; //导入依赖的package包/类
/**
 * Returns the context to which the actual SSL session is bound. A SSL
 * context consists of (1) a possible delegate, (2) a provider and (3) a
 * protocol. If the security manager is activated and one tries to access
 * the SSL context an exception may be thrown if a
 * <code>SSLPermission("getSSLSessionContext")</code>
 * permission is not set.
 * @return the SSL context used for this session, or null if it is
 * unavailable.
 */
public SSLSessionContext getSessionContext() {
    SecurityManager sm = System.getSecurityManager();
    if (sm != null) {
        sm.checkPermission(new SSLPermission("getSSLSessionContext"));
    }
    return sessionContext;
}
 
开发者ID:keplersj,项目名称:In-the-Box-Fork,代码行数:18,代码来源:OpenSSLSessionImpl.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java TObjectHash类代码示例发布时间:2022-05-21
下一篇:
Java ActiveMQComponent类代码示例发布时间:2022-05-21
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap