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


Java NameConstraintsExtension.clone方法代码示例

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


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

示例1: 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

示例2: 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

示例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:openjdk,项目名称:jdk7-jdk,代码行数:50,代码来源:ConstraintsChecker.java


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