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


Java X509CertPath类代码示例

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


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

示例1: engineGenerateCertPath

import sun.security.provider.certpath.X509CertPath; //导入依赖的package包/类
/**
 * Generates a <code>CertPath</code> object and initializes it with
 * the data read from the <code>InputStream</code> inStream. The data
 * is assumed to be in the default encoding.
 *
 * @param inStream an <code>InputStream</code> containing the data
 * @return a <code>CertPath</code> initialized with the data from the
 *   <code>InputStream</code>
 * @exception CertificateException if an exception occurs while decoding
 * @since 1.4
 */
@Override
public CertPath engineGenerateCertPath(InputStream inStream)
    throws CertificateException
{
    if (inStream == null) {
        throw new CertificateException("Missing input stream");
    }
    try {
        byte[] encoding = readOneBlock(inStream);
        if (encoding != null) {
            return new X509CertPath(new ByteArrayInputStream(encoding));
        } else {
            throw new IOException("Empty input");
        }
    } catch (IOException ioe) {
        throw new CertificateException(ioe.getMessage());
    }
}
 
开发者ID:SunburstApps,项目名称:OpenJSharp,代码行数:30,代码来源:X509Factory.java

示例2: main

import sun.security.provider.certpath.X509CertPath; //导入依赖的package包/类
public static void main(String[] args) throws Exception {
    List certs = new Vector();
    certs.add("The 1st certificate");
    certs.add("The 2nd certificate");
    certs.add("The 3rd certificate");
    certs.add("The 4th certificate");

    try {
        X509CertPath cp = new X509CertPath(certs);
        throw new Exception("No expected CertificateException thrown");
    } catch (CertificateException ce) {
        // get the expected exception
    } catch (Exception e) {
        throw new Exception("No expected CertificateException thrown", e);
    }

}
 
开发者ID:lambdalab-mirror,项目名称:jdk8u-jdk,代码行数:18,代码来源:IllegalCertiticates.java

示例3: engineGenerateCertPath

import sun.security.provider.certpath.X509CertPath; //导入依赖的package包/类
/**
 * Generates a <code>CertPath</code> object and initializes it with
 * the data read from the <code>InputStream</code> inStream. The data
 * is assumed to be in the default encoding.
 *
 * @param inStream an <code>InputStream</code> containing the data
 * @return a <code>CertPath</code> initialized with the data from the
 *   <code>InputStream</code>
 * @exception CertificateException if an exception occurs while decoding
 * @since 1.4
 */
public CertPath engineGenerateCertPath(InputStream inStream)
    throws CertificateException
{
    if (inStream == null) {
        throw new CertificateException("Missing input stream");
    }
    try {
        byte[] encoding = readOneBlock(inStream);
        if (encoding != null) {
            return new X509CertPath(new ByteArrayInputStream(encoding));
        } else {
            throw new IOException("Empty input");
        }
    } catch (IOException ioe) {
        throw new CertificateException(ioe.getMessage());
    }
}
 
开发者ID:openjdk,项目名称:jdk7-jdk,代码行数:29,代码来源:X509Factory.java

示例4: createNotifyFailureMessage

import sun.security.provider.certpath.X509CertPath; //导入依赖的package包/类
private Message createNotifyFailureMessage(Interest interest) {
	ObjectDeployment interested = interest.getInterested();
	Message message = 
		new Message(interested.getModule().getContainerID(), interested.getDeploymentID(), 
				interest.getFailureNotificationMethod().getName());
	
	DeploymentID stubDeploymentID = 
		interestProcessor.getModule().getStubDeploymentID(interest.getStubServiceID());
	Class<?> stubType = interest.getFailureNotificationMethod().getParameterTypes()[0];
	
	StubParameter stubParameter = new StubParameter(stubDeploymentID);
	message.addParameter(stubType, stubParameter);
	
	if (interest.hasFailureNotificationMethodDeploymentID()) {
		message.addParameter(DeploymentID.class, stubDeploymentID);
	}

	if (interest.hasFailureNotificationMethodCertificate()) {
		message.addParameter(X509CertPath.class, interest.getInterestCertPath());
	}
	
	return message;
}
 
开发者ID:OurGrid,项目名称:commune,代码行数:24,代码来源:InterestManager.java


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