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


Java DEROctetString.getInstance方法代码示例

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


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

示例1: digestSecretKey0

import org.bouncycastle.asn1.DEROctetString; //导入方法依赖的package包/类
@Override
protected byte[] digestSecretKey0(long mechanism) throws P11TokenException {
    Asn1P11EntityIdentifier asn1EntityId = new Asn1P11EntityIdentifier(identityId);
    Asn1DigestSecretKeyTemplate template = new Asn1DigestSecretKeyTemplate(
            asn1EntityId, mechanism);
    byte[] result = ((ProxyP11Slot) slot).module().send(
            P11ProxyConstants.ACTION_DIGEST_SECRETKEY, template);

    ASN1OctetString octetString;
    try {
        octetString = DEROctetString.getInstance(result);
    } catch (IllegalArgumentException ex) {
        throw new P11TokenException("the returned result is not OCTET STRING");
    }

    return (octetString == null) ? null : octetString.getOctets();
}
 
开发者ID:xipki,项目名称:xitk,代码行数:18,代码来源:ProxyP11Identity.java

示例2: SignerInfo

import org.bouncycastle.asn1.DEROctetString; //导入方法依赖的package包/类
public SignerInfo(
    ASN1Sequence seq)
{
    Enumeration     e = seq.getObjects();

    version = (ASN1Integer)e.nextElement();
    issuerAndSerialNumber = IssuerAndSerialNumber.getInstance(e.nextElement());
    digAlgorithm = AlgorithmIdentifier.getInstance(e.nextElement());

    Object obj = e.nextElement();

    if (obj instanceof ASN1TaggedObject)
    {
        authenticatedAttributes = ASN1Set.getInstance((ASN1TaggedObject)obj, false);

        digEncryptionAlgorithm = AlgorithmIdentifier.getInstance(e.nextElement());
    }
    else
    {
        authenticatedAttributes = null;
        digEncryptionAlgorithm = AlgorithmIdentifier.getInstance(obj);
    }

    encryptedDigest = DEROctetString.getInstance(e.nextElement());

    if (e.hasMoreElements())
    {
        unauthenticatedAttributes = ASN1Set.getInstance((ASN1TaggedObject)e.nextElement(), false);
    }
    else
    {
        unauthenticatedAttributes = null;
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:35,代码来源:SignerInfo.java

示例3: SignerInfo

import org.bouncycastle.asn1.DEROctetString; //导入方法依赖的package包/类
/**
 * @deprecated use getInstance() method.
 */
public SignerInfo(
    ASN1Sequence seq)
{
    Enumeration     e = seq.getObjects();

    version = (ASN1Integer)e.nextElement();
    sid = SignerIdentifier.getInstance(e.nextElement());
    digAlgorithm = AlgorithmIdentifier.getInstance(e.nextElement());

    Object obj = e.nextElement();

    if (obj instanceof ASN1TaggedObject)
    {
        authenticatedAttributes = ASN1Set.getInstance((ASN1TaggedObject)obj, false);

        digEncryptionAlgorithm = AlgorithmIdentifier.getInstance(e.nextElement());
    }
    else
    {
        authenticatedAttributes = null;
        digEncryptionAlgorithm = AlgorithmIdentifier.getInstance(obj);
    }

    encryptedDigest = DEROctetString.getInstance(e.nextElement());

    if (e.hasMoreElements())
    {
        unauthenticatedAttributes = ASN1Set.getInstance((ASN1TaggedObject)e.nextElement(), false);
    }
    else
    {
        unauthenticatedAttributes = null;
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:38,代码来源:SignerInfo.java

示例4: sign0

import org.bouncycastle.asn1.DEROctetString; //导入方法依赖的package包/类
@Override
protected byte[] sign0(long mechanism, P11Params parameters, byte[] content)
        throws P11TokenException {
    Asn1P11EntityIdentifier asn1EntityId = new Asn1P11EntityIdentifier(identityId);
    Asn1P11Params p11Param = null;
    if (parameters instanceof P11RSAPkcsPssParams) {
        p11Param = new Asn1P11Params(
                new Asn1RSAPkcsPssParams((P11RSAPkcsPssParams) parameters));
    } else if (parameters instanceof P11ByteArrayParams) {
        byte[] bytes = ((P11ByteArrayParams) parameters).getBytes();
        p11Param = new Asn1P11Params(new DEROctetString(bytes));
    }

    Asn1SignTemplate signTemplate = new Asn1SignTemplate(asn1EntityId, mechanism, p11Param,
            content);
    byte[] result = ((ProxyP11Slot) slot).module().send(P11ProxyConstants.ACTION_SIGN,
            signTemplate);

    ASN1OctetString octetString;
    try {
        octetString = DEROctetString.getInstance(result);
    } catch (IllegalArgumentException ex) {
        throw new P11TokenException("the returned result is not OCTET STRING");
    }

    return (octetString == null) ? null : octetString.getOctets();
}
 
开发者ID:xipki,项目名称:xitk,代码行数:28,代码来源:ProxyP11Identity.java

示例5: Asn1P11Params

import org.bouncycastle.asn1.DEROctetString; //导入方法依赖的package包/类
private Asn1P11Params(ASN1TaggedObject taggedObject) throws BadAsn1ObjectException {
    this.tagNo = taggedObject.getTagNo();
    if (tagNo == 0) {
        this.p11Params = Asn1RSAPkcsPssParams.getInstance(taggedObject.getObject());
    } else if (tagNo == 1) {
        this.p11Params = DEROctetString.getInstance(taggedObject.getObject());
    } else {
        throw new BadAsn1ObjectException("invalid tag " + tagNo);
    }
}
 
开发者ID:xipki,项目名称:xitk,代码行数:11,代码来源:Asn1P11Params.java

示例6: removingTagAndLenFromExtensionValue

import org.bouncycastle.asn1.DEROctetString; //导入方法依赖的package包/类
private static byte[] removingTagAndLenFromExtensionValue(byte[] encodedExtensionValue) {
    DEROctetString derOctet = (DEROctetString) DEROctetString.getInstance(
            encodedExtensionValue);
    return derOctet.getOctets();
}
 
开发者ID:xipki,项目名称:xitk,代码行数:6,代码来源:ExtractCertFromCrlCmd.java


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