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


Java QCStatement.getStatementInfo方法代码示例

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


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

示例1: checkStatement

import org.bouncycastle.asn1.x509.qualified.QCStatement; //导入方法依赖的package包/类
private void checkStatement(
    QCStatement         qcs,
    DERObjectIdentifier statementId,
    ASN1Encodable       statementInfo)
    throws IOException
{
    if (!qcs.getStatementId().equals(statementId))
    {
        fail("statementIds don't match.");
    }
    
    if (statementInfo != null)
    {
        if (!qcs.getStatementInfo().equals(statementInfo))
        {
            fail("statementInfos don't match.");
        }
    }
    else if (qcs.getStatementInfo() != null)
    {
        fail("statementInfo found when none expected.");
    }
}
 
开发者ID:credentials,项目名称:irma_future_id,代码行数:24,代码来源:QCStatementUnitTest.java

示例2: getQCTypesIdList

import org.bouncycastle.asn1.x509.qualified.QCStatement; //导入方法依赖的package包/类
/**
 * Get the list of all QCType Ids that are present in the certificate.
 * (As per ETSI EN 319 412-5 V2.1.1)
 * 
 * @param certToken
 * @return
 */
public static List<String> getQCTypesIdList(final CertificateToken certToken) {
	final List<String> qcTypesIdList = new ArrayList<String>();
	final byte[] qcStatement = certToken.getCertificate().getExtensionValue(Extension.qCStatements.getId());
	if (qcStatement != null) {
		final ASN1Sequence seq = getAsn1SequenceFromDerOctetString(qcStatement);
		// Sequence of QCStatement
		for (int ii = 0; ii < seq.size(); ii++) {
			final QCStatement statement = QCStatement.getInstance(seq.getObjectAt(ii));
			if (QC_TYPE_STATEMENT_OID.equals(statement.getStatementId().getId())) {
				final ASN1Encodable qcTypeInfo1 = statement.getStatementInfo();
				if (qcTypeInfo1 instanceof ASN1Sequence) {
					final ASN1Sequence qcTypeInfo = (ASN1Sequence) qcTypeInfo1;
					for (int jj = 0; jj < qcTypeInfo.size(); jj++) {
						final ASN1Encodable e1 = qcTypeInfo.getObjectAt(jj);
						if (e1 instanceof ASN1ObjectIdentifier) {
							final ASN1ObjectIdentifier oid = (ASN1ObjectIdentifier) e1;
							qcTypesIdList.add(oid.getId());
						} else {
							throw new IllegalStateException("ASN1Sequence in QcTypes does not contain ASN1ObjectIdentifer, but " + e1.getClass().getName());
						}
					}
				} else {
					throw new IllegalStateException("QcTypes not an ASN1Sequence, but " + qcTypeInfo1.getClass().getName());
				}
			}
		}
	}

	return qcTypesIdList;
}
 
开发者ID:esig,项目名称:dss,代码行数:38,代码来源:DSSASN1Utils.java


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