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


Java AlgorithmConstraints.permits方法代码示例

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


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

示例1: getSupportedAlgorithms

import java.security.AlgorithmConstraints; //导入方法依赖的package包/类
static Collection<SignatureAndHashAlgorithm>
        getSupportedAlgorithms(AlgorithmConstraints constraints) {

    Collection<SignatureAndHashAlgorithm> supported = new ArrayList<>();
    synchronized (priorityMap) {
        for (SignatureAndHashAlgorithm sigAlg : priorityMap.values()) {
            if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM &&
                    constraints.permits(SIGNATURE_PRIMITIVE_SET,
                            sigAlg.algorithm, null)) {
                supported.add(sigAlg);
            }
        }
    }

    return supported;
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:17,代码来源:SignatureAndHashAlgorithm.java

示例2: createExtension

import java.security.AlgorithmConstraints; //导入方法依赖的package包/类
static SupportedEllipticCurvesExtension createExtension(
            AlgorithmConstraints constraints) {

    ArrayList<Integer> idList = new ArrayList<>(supportedCurveIds.length);
    for (int curveId : supportedCurveIds) {
        if (constraints.permits(
                EnumSet.of(CryptoPrimitive.KEY_AGREEMENT),
                            "EC", idToParams.get(curveId))) {
            idList.add(curveId);
        }
    }

    if (!idList.isEmpty()) {
        int[] ids = new int[idList.size()];
        int i = 0;
        for (Integer id : idList) {
            ids[i++] = id;
        }

        return new SupportedEllipticCurvesExtension(ids);
    }

    return null;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:25,代码来源:SupportedEllipticCurvesExtension.java

示例3: getPreferredGroup

import java.security.AlgorithmConstraints; //导入方法依赖的package包/类
NamedGroup getPreferredGroup(
        AlgorithmConstraints constraints, NamedGroupType type) {

    for (int groupId : requestedNamedGroupIds) {
        NamedGroup namedGroup = NamedGroup.valueOf(groupId);
        if ((namedGroup != null) && (namedGroup.type == type) &&
            SupportedGroupsExtension.supports(namedGroup) &&
            constraints.permits(EnumSet.of(CryptoPrimitive.KEY_AGREEMENT),
                namedGroup.algorithm, namedGroupParams.get(namedGroup))) {

            return namedGroup;
        }
    }

    return null;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:17,代码来源:SupportedGroupsExtension.java

示例4: getPreferredCurve

import java.security.AlgorithmConstraints; //导入方法依赖的package包/类
private static int getPreferredCurve(int[] curves,
            AlgorithmConstraints constraints) {
    for (int curveId : curves) {
        if (isSupported(curveId) && constraints.permits(
                EnumSet.of(CryptoPrimitive.KEY_AGREEMENT),
                            "EC", idToParams.get(curveId))) {
            return curveId;
        }
    }

    return -1;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:13,代码来源:SupportedEllipticCurvesExtension.java

示例5: getSupportedAlgorithms

import java.security.AlgorithmConstraints; //导入方法依赖的package包/类
static Collection<SignatureAndHashAlgorithm>
        getSupportedAlgorithms(AlgorithmConstraints constraints) {

    Collection<SignatureAndHashAlgorithm> supported = new ArrayList<>();
    for (SignatureAndHashAlgorithm sigAlg : priorityMap.values()) {
        if (sigAlg.priority <= SUPPORTED_ALG_PRIORITY_MAX_NUM &&
                constraints.permits(SIGNATURE_PRIMITIVE_SET,
                        sigAlg.algorithm, null)) {
            supported.add(sigAlg);
        }
    }

    return supported;
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:15,代码来源:SignatureAndHashAlgorithm.java

示例6: getPreferredECGroup

import java.security.AlgorithmConstraints; //导入方法依赖的package包/类
static NamedGroup getPreferredECGroup(AlgorithmConstraints constraints) {
    for (NamedGroup namedGroup : supportedNamedGroups) {
        if ((namedGroup.type == NamedGroupType.NAMED_GROUP_ECDHE) &&
            constraints.permits(EnumSet.of(CryptoPrimitive.KEY_AGREEMENT),
                namedGroup.algorithm, namedGroupParams.get(namedGroup))) {

            return namedGroup;
        }
    }

    return null;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:13,代码来源:SupportedGroupsExtension.java

示例7: isActivatable

import java.security.AlgorithmConstraints; //导入方法依赖的package包/类
static boolean isActivatable(
        AlgorithmConstraints constraints, NamedGroupType type) {

    boolean hasFFDHEGroups = false;
    for (NamedGroup namedGroup : supportedNamedGroups) {
        if (namedGroup.type == type) {
            if (constraints.permits(
                    EnumSet.of(CryptoPrimitive.KEY_AGREEMENT),
                    namedGroup.algorithm,
                    namedGroupParams.get(namedGroup))) {

                return true;
            }

            if (!hasFFDHEGroups &&
                    (type == NamedGroupType.NAMED_GROUP_FFDHE)) {

                hasFFDHEGroups = true;
            }
        }
    }

    // For compatibility, if no FFDHE groups are defined, the non-FFDHE
    // compatible mode (using DHE cipher suite without FFDHE extension)
    // is allowed.
    //
    // Note that the constraints checking on DHE parameters will be
    // performed during key exchanging in a handshake.
    if (!hasFFDHEGroups && (type == NamedGroupType.NAMED_GROUP_FFDHE)) {
        return true;
    }

    return false;
}
 
开发者ID:AdoptOpenJDK,项目名称:openjdk-jdk10,代码行数:35,代码来源:SupportedGroupsExtension.java


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