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


Java BERSequence类代码示例

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


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

示例1: toASN1Object

import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
/**
 * Produce an object suitable for an ASN1OutputStream.
 * <pre>
 *  SignedData ::= SEQUENCE {
 *      version Version,
 *      digestAlgorithms DigestAlgorithmIdentifiers,
 *      contentInfo ContentInfo,
 *      certificates
 *          [0] IMPLICIT ExtendedCertificatesAndCertificates
 *                   OPTIONAL,
 *      crls
 *          [1] IMPLICIT CertificateRevocationLists OPTIONAL,
 *      signerInfos SignerInfos }
 * </pre>
 */
public DERObject toASN1Object()
{
    ASN1EncodableVector v = new ASN1EncodableVector();

    v.add(version);
    v.add(digestAlgorithms);
    v.add(contentInfo);

    if (certificates != null)
    {
        v.add(new DERTaggedObject(false, 0, certificates));
    }

    if (crls != null)
    {
        v.add(new DERTaggedObject(false, 1, crls));
    }

    v.add(signerInfos);

    return new BERSequence(v);
}
 
开发者ID:PhilippC,项目名称:keepass2android,代码行数:38,代码来源:SignedData.java

示例2: toASN1Primitive

import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
/**
 * Produce an object suitable for an ASN1OutputStream.
 * <pre>
 *  SignedData ::= SEQUENCE {
 *      version Version,
 *      digestAlgorithms DigestAlgorithmIdentifiers,
 *      contentInfo ContentInfo,
 *      certificates
 *          [0] IMPLICIT ExtendedCertificatesAndCertificates
 *                   OPTIONAL,
 *      crls
 *          [1] IMPLICIT CertificateRevocationLists OPTIONAL,
 *      signerInfos SignerInfos }
 * </pre>
 */
public ASN1Primitive toASN1Primitive()
{
    ASN1EncodableVector v = new ASN1EncodableVector();

    v.add(version);
    v.add(digestAlgorithms);
    v.add(contentInfo);

    if (certificates != null)
    {
        v.add(new DERTaggedObject(false, 0, certificates));
    }

    if (crls != null)
    {
        v.add(new DERTaggedObject(false, 1, crls));
    }

    v.add(signerInfos);

    return new BERSequence(v);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:38,代码来源:SignedData.java

示例3: toASN1Primitive

import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
public ASN1Primitive toASN1Primitive()
{
    ASN1EncodableVector v = new ASN1EncodableVector();

    for (int i = 0; i != info.length; i++)
    {
        v.add(info[i]);
    }

    if (isBer)
    {
        return new BERSequence(v);
    }
    else
    {
        return new DLSequence(v);
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:19,代码来源:AuthenticatedSafe.java

示例4: toASN1Primitive

import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
/**
 * Produce an object suitable for an ASN1OutputStream.
 * <pre>
 * ContentInfo ::= SEQUENCE {
 *          contentType ContentType,
 *          content
 *          [0] EXPLICIT ANY DEFINED BY contentType OPTIONAL }
 * </pre>
 */
public ASN1Primitive toASN1Primitive()
{
    ASN1EncodableVector v = new ASN1EncodableVector();

    v.add(contentType);

    if (content != null)
    {
        v.add(new BERTaggedObject(true, 0, content));
    }

    if (isBer)
    {
        return new BERSequence(v);
    }
    else
    {
        return new DLSequence(v);
    }
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:30,代码来源:ContentInfo.java

示例5: toASN1Primitive

import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
/** 
 * Produce an object suitable for an ASN1OutputStream.
 * <pre>
 * EnvelopedData ::= SEQUENCE {
 *     version CMSVersion,
 *     originatorInfo [0] IMPLICIT OriginatorInfo OPTIONAL,
 *     recipientInfos RecipientInfos,
 *     encryptedContentInfo EncryptedContentInfo,
 *     unprotectedAttrs [1] IMPLICIT UnprotectedAttributes OPTIONAL 
 * }
 * </pre>
 */
public ASN1Primitive toASN1Primitive()
{
    ASN1EncodableVector  v = new ASN1EncodableVector();
    
    v.add(version);

    if (originatorInfo != null)
    {
        v.add(new DERTaggedObject(false, 0, originatorInfo));
    }

    v.add(recipientInfos);
    v.add(encryptedContentInfo);

    if (unprotectedAttrs != null)
    {
        v.add(new DERTaggedObject(false, 1, unprotectedAttrs));
    }
    
    return new BERSequence(v);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:34,代码来源:EnvelopedData.java

示例6: toASN1Primitive

import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
/**
 * <pre>
 * TimeStampedData ::= SEQUENCE {
 *   version              INTEGER { v1(1) },
 *   dataUri              IA5String OPTIONAL,
 *   metaData             MetaData OPTIONAL,
 *   content              OCTET STRING OPTIONAL,
 *   temporalEvidence     Evidence
 * }
 * </pre>
 * @return
 */
public ASN1Primitive toASN1Primitive()
{
    ASN1EncodableVector v = new ASN1EncodableVector();

    v.add(version);

    if (dataUri != null)
    {
        v.add(dataUri);
    }

    if (metaData != null)
    {
        v.add(metaData);
    }

    if (content != null)
    {
        v.add(content);
    }

    v.add(temporalEvidence);

    return new BERSequence(v);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:38,代码来源:TimeStampedData.java

示例7: toASN1Primitive

import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
/**
 * <pre>
 * TimeStampedData ::= SEQUENCE {
 *   version              INTEGER { v1(1) },
 *   dataUri              IA5String OPTIONAL,
 *   metaData             MetaData OPTIONAL,
 *   content              OCTET STRING OPTIONAL,
 *   temporalEvidence     Evidence
 * }
 * </pre>
 * @return
 * @deprecated will be removed
 */
public ASN1Primitive toASN1Primitive()
{
    ASN1EncodableVector v = new ASN1EncodableVector();

    v.add(version);

    if (dataUri != null)
    {
        v.add(dataUri);
    }

    if (metaData != null)
    {
        v.add(metaData);
    }

    if (content != null)
    {
        v.add(content);
    }

    v.add(temporalEvidence);

    return new BERSequence(v);
}
 
开发者ID:Appdome,项目名称:ipack,代码行数:39,代码来源:TimeStampedDataParser.java

示例8: toASN1Primitive

import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
/** 
 * Produce an object suitable for an ASN1OutputStream.
 */
public ASN1Primitive toASN1Primitive()
{
    ASN1EncodableVector  v = new ASN1EncodableVector();
    
    v.add(version);

    if (originatorInfo != null)
    {
        v.add(new DERTaggedObject(false, 0, originatorInfo));
    }

    v.add(recipientInfos);
    v.add(encryptedContentInfo);

    if (unprotectedAttrs != null)
    {
        v.add(new DERTaggedObject(false, 1, unprotectedAttrs));
    }
    
    return new BERSequence(v);
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:25,代码来源:EnvelopedData.java

示例9: toASN1Primitive

import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
public ASN1Primitive toASN1Primitive()
{
    ASN1EncodableVector v = new ASN1EncodableVector();

    v.add(version);

    if (dataUri != null)
    {
        v.add(dataUri);
    }

    if (metaData != null)
    {
        v.add(metaData);
    }

    if (content != null)
    {
        v.add(content);
    }

    v.add(temporalEvidence);

    return new BERSequence(v);
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:26,代码来源:TimeStampedData.java

示例10: shouldFailOnExtraData

import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
public void shouldFailOnExtraData()
    throws Exception
{
    // basic construction
    DERBitString s1 = new DERBitString(new byte[0], 0);

    ASN1Primitive.fromByteArray(s1.getEncoded());

    ASN1Primitive.fromByteArray(new BERSequence(s1).getEncoded());

    try
    {
        ASN1Primitive obj = ASN1Primitive.fromByteArray(Arrays.concatenate(s1.getEncoded(), new byte[1]));
        fail("no exception");
    }
    catch (IOException e)
    {
        if (!"Extra data detected in stream".equals(e.getMessage()))
        {
            fail("wrong exception");
        }
    }
}
 
开发者ID:ttt43ttt,项目名称:gwt-crypto,代码行数:24,代码来源:MiscTest.java

示例11: getDERObject

import org.bouncycastle.asn1.BERSequence; //导入依赖的package包/类
/**
 * Produce an object suitable for an ASN1OutputStream.
 * <pre>
 *  SignedData ::= SEQUENCE {
 *      version Version,
 *      digestAlgorithms DigestAlgorithmIdentifiers,
 *      contentInfo ContentInfo,
 *      certificates
 *          [0] IMPLICIT ExtendedCertificatesAndCertificates
 *                   OPTIONAL,
 *      crls
 *          [1] IMPLICIT CertificateRevocationLists OPTIONAL,
 *      signerInfos SignerInfos }
 * </pre>
 */
public DERObject getDERObject()
{
    ASN1EncodableVector v = new ASN1EncodableVector();

    v.add(version);
    v.add(digestAlgorithms);
    v.add(contentInfo);

    if (certificates != null)
    {
        v.add(new DERTaggedObject(false, 0, certificates));
    }

    if (crls != null)
    {
        v.add(new DERTaggedObject(false, 1, crls));
    }

    v.add(signerInfos);

    return new BERSequence(v);
}
 
开发者ID:AcademicTorrents,项目名称:AcademicTorrents-Downloader,代码行数:38,代码来源:SignedData.java


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