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


Java NameConstraintsExtension类代码示例

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


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

示例1: clone

import sun.security.x509.NameConstraintsExtension; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked") // Safe casts assuming clone() works correctly
public Object clone() {
    try {
        ReverseState clonedState = (ReverseState) super.clone();

        /* clone checkers, if cloneable */
        clonedState.userCheckers =
                    (ArrayList<PKIXCertPathChecker>)userCheckers.clone();
        ListIterator<PKIXCertPathChecker> li =
                    clonedState.userCheckers.listIterator();
        while (li.hasNext()) {
            PKIXCertPathChecker checker = li.next();
            if (checker instanceof Cloneable) {
                li.set((PKIXCertPathChecker)checker.clone());
            }
        }

        /* make copy of name constraints */
        if (nc != null) {
            clonedState.nc = (NameConstraintsExtension) nc.clone();
        }

        /* make copy of policy tree */
        if (rootNode != null) {
            clonedState.rootNode = rootNode.copyTree();
        }

        return clonedState;
    } catch (CloneNotSupportedException e) {
        throw new InternalError(e.toString(), e);
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:34,代码来源:ReverseState.java

示例2: clone

import sun.security.x509.NameConstraintsExtension; //导入依赖的package包/类
public Object clone() {
    try {
        ReverseState clonedState = (ReverseState) super.clone();

        /* clone checkers, if cloneable */
        clonedState.userCheckers =
                    (ArrayList<PKIXCertPathChecker>)userCheckers.clone();
        ListIterator<PKIXCertPathChecker> li =
                    clonedState.userCheckers.listIterator();
        while (li.hasNext()) {
            PKIXCertPathChecker checker = li.next();
            if (checker instanceof Cloneable) {
                li.set((PKIXCertPathChecker)checker.clone());
            }
        }

        /* make copy of name constraints */
        if (nc != null) {
            clonedState.nc = (NameConstraintsExtension) nc.clone();
        }

        /* make copy of policy tree */
        if (rootNode != null) {
            clonedState.rootNode = rootNode.copyTree();
        }

        return clonedState;
    } catch (CloneNotSupportedException e) {
        throw new InternalError(e.toString());
    }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:32,代码来源:ReverseState.java

示例3: mergeNameConstraints

import sun.security.x509.NameConstraintsExtension; //导入依赖的package包/类
/**
 * Helper to fold sets of name constraints together
 */
static NameConstraintsExtension mergeNameConstraints(
    X509Certificate currCert, NameConstraintsExtension prevNC)
    throws CertPathValidatorException
{
    X509CertImpl currCertImpl;
    try {
        currCertImpl = X509CertImpl.toImpl(currCert);
    } catch (CertificateException ce) {
        throw new CertPathValidatorException(ce);
    }

    NameConstraintsExtension newConstraints =
        currCertImpl.getNameConstraintsExtension();

    if (debug != null) {
        debug.println("prevNC = " + prevNC);
        debug.println("newNC = " + String.valueOf(newConstraints));
    }

    // if there are no previous name constraints, we just return the
    // new name constraints.
    if (prevNC == null) {
        if (debug != null) {
            debug.println("mergedNC = " + String.valueOf(newConstraints));
        }
        if (newConstraints == null) {
            return newConstraints;
        } else {
            // Make sure we do a clone here, because we're probably
            // going to modify this object later and we don't want to
            // be sharing it with a Certificate object!
            return (NameConstraintsExtension)newConstraints.clone();
        }
    } else {
        try {
            // after merge, prevNC should contain the merged constraints
            prevNC.merge(newConstraints);
        } catch (IOException ioe) {
            throw new CertPathValidatorException(ioe);
        }
        if (debug != null) {
            debug.println("mergedNC = " + prevNC);
        }
        return prevNC;
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:50,代码来源:ConstraintsChecker.java

示例4: mergeNameConstraints

import sun.security.x509.NameConstraintsExtension; //导入依赖的package包/类
/**
 * Helper to fold sets of name constraints together
 */
static NameConstraintsExtension mergeNameConstraints(
    X509Certificate currCert, NameConstraintsExtension prevNC)
    throws CertPathValidatorException
{
    X509CertImpl currCertImpl;
    try {
        currCertImpl = X509CertImpl.toImpl(currCert);
    } catch (CertificateException ce) {
        throw new CertPathValidatorException(ce);
    }

    NameConstraintsExtension newConstraints =
        currCertImpl.getNameConstraintsExtension();

    if (debug != null) {
        debug.println("prevNC = " + prevNC +
                    ", newNC = " + String.valueOf(newConstraints));
    }

    // if there are no previous name constraints, we just return the
    // new name constraints.
    if (prevNC == null) {
        if (debug != null) {
            debug.println("mergedNC = " + String.valueOf(newConstraints));
        }
        if (newConstraints == null) {
            return newConstraints;
        } else {
            // Make sure we do a clone here, because we're probably
            // going to modify this object later and we don't want to
            // be sharing it with a Certificate object!
            return (NameConstraintsExtension)newConstraints.clone();
        }
    } else {
        try {
            // after merge, prevNC should contain the merged constraints
            prevNC.merge(newConstraints);
        } catch (IOException ioe) {
            throw new CertPathValidatorException(ioe);
        }
        if (debug != null) {
            debug.println("mergedNC = " + prevNC);
        }
        return prevNC;
    }
}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:50,代码来源:ConstraintsChecker.java

示例5: mergeNameConstraints

import sun.security.x509.NameConstraintsExtension; //导入依赖的package包/类
/**
 * Helper to fold sets of name constraints together
 */
static NameConstraintsExtension
    mergeNameConstraints(X509Certificate currCert,
        NameConstraintsExtension prevNC) throws CertPathValidatorException
{
    X509CertImpl currCertImpl;
    try {
        currCertImpl = X509CertImpl.toImpl(currCert);
    } catch (CertificateException ce) {
        throw new CertPathValidatorException(ce);
    }

    NameConstraintsExtension newConstraints =
        currCertImpl.getNameConstraintsExtension();

    if (debug != null) {
        debug.println("prevNC = " + prevNC);
        debug.println("newNC = " + String.valueOf(newConstraints));
    }

    // if there are no previous name constraints, we just return the
    // new name constraints.
    if (prevNC == null) {
        if (debug != null) {
            debug.println("mergedNC = " + String.valueOf(newConstraints));
        }
        if (newConstraints == null) {
            return newConstraints;
        } else {
            // Make sure we do a clone here, because we're probably
            // going to modify this object later and we don't want to
            // be sharing it with a Certificate object!
            return (NameConstraintsExtension) newConstraints.clone();
        }
    } else {
        try {
            // after merge, prevNC should contain the merged constraints
            prevNC.merge(newConstraints);
        } catch (IOException ioe) {
            throw new CertPathValidatorException(ioe);
        }
        if (debug != null) {
            debug.println("mergedNC = " + prevNC);
        }
        return prevNC;
    }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:50,代码来源:ConstraintsChecker.java


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