• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java SignerIdentifier类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: SignerInfoGenerator

import org.bouncycastle.asn1.cms.SignerIdentifier; //导入依赖的package包/类
SignerInfoGenerator(
    SignerIdentifier signerIdentifier,
    ContentSigner signer,
    DigestCalculatorProvider digesterProvider,
    CMSSignatureEncryptionAlgorithmFinder sigEncAlgFinder,
    CMSAttributeTableGenerator sAttrGen,
    CMSAttributeTableGenerator unsAttrGen)
    throws OperatorCreationException
{
    this.signerIdentifier = signerIdentifier;
    this.signer = signer;

    if (digesterProvider != null)
    {
        this.digester = digesterProvider.get(digAlgFinder.find(signer.getAlgorithmIdentifier()));
    }
    else
    {
        this.digester = null;
    }

    this.sAttrGen = sAttrGen;
    this.unsAttrGen = unsAttrGen;
    this.sigEncAlgFinder = sigEncAlgFinder;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:26,代码来源:SignerInfoGenerator.java


示例2: createGenerator

import org.bouncycastle.asn1.cms.SignerIdentifier; //导入依赖的package包/类
private SignerInfoGenerator createGenerator(ContentSigner contentSigner, SignerIdentifier sigId)
    throws OperatorCreationException
{
    if (directSignature)
    {
        return new SignerInfoGenerator(sigId, contentSigner, digestProvider, sigEncAlgFinder, true);
    }

    if (signedGen != null || unsignedGen != null)
    {
        if (signedGen == null)
        {
            signedGen = new DefaultSignedAttributeTableGenerator();
        }

        return new SignerInfoGenerator(sigId, contentSigner, digestProvider, sigEncAlgFinder, signedGen, unsignedGen);
    }
    
    return new SignerInfoGenerator(sigId, contentSigner, digestProvider, sigEncAlgFinder);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:21,代码来源:SignerInfoGeneratorBuilder.java


示例3: SignerInformation

import org.bouncycastle.asn1.cms.SignerIdentifier; //导入依赖的package包/类
SignerInformation(
    SignerInfo          info,
    ASN1ObjectIdentifier contentType,
    CMSProcessable      content,
    byte[]              resultDigest)
{
    this.info = info;
    this.contentType = contentType;
    this.isCounterSignature = contentType == null;

    SignerIdentifier   s = info.getSID();

    if (s.isTagged())
    {
        ASN1OctetString octs = ASN1OctetString.getInstance(s.getId());

        sid = new SignerId(octs.getOctets());
    }
    else
    {
        IssuerAndSerialNumber   iAnds = IssuerAndSerialNumber.getInstance(s.getId());

        sid = new SignerId(iAnds.getName(), iAnds.getSerialNumber().getValue());
    }

    this.digestAlgorithm = info.getDigestAlgorithm();
    this.signedAttributeSet = info.getAuthenticatedAttributes();
    this.unsignedAttributeSet = info.getUnauthenticatedAttributes();
    this.encryptionAlgorithm = info.getDigestEncryptionAlgorithm();
    this.signature = info.getEncryptedDigest().getOctets();

    this.content = content;
    this.resultDigest = resultDigest;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:35,代码来源:SignerInformation.java


示例4: build

import org.bouncycastle.asn1.cms.SignerIdentifier; //导入依赖的package包/类
/**
 * Build a generator with the passed in certHolder issuer and serial number as the signerIdentifier.
 *
 * @param contentSigner  operator for generating the final signature in the SignerInfo with.
 * @param certHolder  carrier for the X.509 certificate related to the contentSigner.
 * @return  a SignerInfoGenerator
 * @throws OperatorCreationException   if the generator cannot be built.
 */
public SignerInfoGenerator build(ContentSigner contentSigner, X509CertificateHolder certHolder)
    throws OperatorCreationException
{
    SignerIdentifier sigId = new SignerIdentifier(new IssuerAndSerialNumber(certHolder.toASN1Structure()));

    SignerInfoGenerator sigInfoGen = createGenerator(contentSigner, sigId);

    sigInfoGen.setAssociatedCertificate(certHolder);

    return sigInfoGen;
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:20,代码来源:SignerInfoGeneratorBuilder.java


示例5: getSignedFields

import org.bouncycastle.asn1.cms.SignerIdentifier; //导入依赖的package包/类
/**
 * 3) Fields version, sid, digestAlgorithm, signedAttrs, signatureAlgorithm, and
 * signature within the SignedData.signerInfos’s item corresponding to the signature being archive
 * time-stamped, in their order of appearance.
 *
 * @param signerInformation
 * @return
 */
private byte[] getSignedFields(final SignerInformation signerInformation) {

	final SignerInfo signerInfo = signerInformation.toASN1Structure();
	final ASN1Integer version = signerInfo.getVersion();
	final SignerIdentifier sid = signerInfo.getSID();
	final AlgorithmIdentifier digestAlgorithm = signerInfo.getDigestAlgorithm();
	final DERTaggedObject signedAttributes = CMSUtils.getDERSignedAttributes(signerInformation);
	final AlgorithmIdentifier digestEncryptionAlgorithm = signerInfo.getDigestEncryptionAlgorithm();
	final ASN1OctetString encryptedDigest = signerInfo.getEncryptedDigest();

	final byte[] derEncodedVersion = DSSASN1Utils.getDEREncoded(version);
	final byte[] derEncodedSid = DSSASN1Utils.getDEREncoded(sid);
	final byte[] derEncodedDigestAlgorithm = DSSASN1Utils.getDEREncoded(digestAlgorithm);
	final byte[] derEncodedSignedAttributes = DSSASN1Utils.getDEREncoded(signedAttributes);
	final byte[] derEncodedDigestEncryptionAlgorithm = DSSASN1Utils.getDEREncoded(digestEncryptionAlgorithm);
	final byte[] derEncodedEncryptedDigest = DSSASN1Utils.getDEREncoded(encryptedDigest);
	if (LOG.isDebugEnabled()) {

		LOG.debug("getSignedFields Version={}", Utils.toBase64(derEncodedVersion));
		LOG.debug("getSignedFields Sid={}", Utils.toBase64(derEncodedSid));
		LOG.debug("getSignedFields DigestAlgorithm={}", Utils.toBase64(derEncodedDigestAlgorithm));
		LOG.debug("getSignedFields SignedAttributes={}", Utils.toBase64(derEncodedSignedAttributes));
		LOG.debug("getSignedFields DigestEncryptionAlgorithm={}", Utils.toBase64(derEncodedDigestEncryptionAlgorithm));
		LOG.debug("getSignedFields EncryptedDigest={}", Utils.toBase64(derEncodedEncryptedDigest));
	}
	final byte[] concatenatedArrays = DSSUtils.concatenate(derEncodedVersion, derEncodedSid, derEncodedDigestAlgorithm, derEncodedSignedAttributes,
			derEncodedDigestEncryptionAlgorithm, derEncodedEncryptedDigest);
	return concatenatedArrays;
}
 
开发者ID:esig,项目名称:dss,代码行数:38,代码来源:CadesLevelBaselineLTATimestampExtractor.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Vpc类代码示例发布时间:2022-05-22
下一篇:
Java AnnotationBasedProfileBuilder类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap