Java 类org.bouncycastle.asn1.BERSequence 实例源码

项目:keepass2android    文件:SignedData.java   
/**
 * 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);
}
项目:ipack    文件:SignedData.java   
/**
 * 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);
}
项目:ipack    文件:AuthenticatedSafe.java   
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);
    }
}
项目:ipack    文件:ContentInfo.java   
/**
 * 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);
    }
}
项目:ipack    文件:EnvelopedData.java   
/** 
 * 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);
}
项目:ipack    文件:TimeStampedData.java   
/**
 * <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);
}
项目:ipack    文件:TimeStampedDataParser.java   
/**
 * <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);
}
项目:KeePass2Android    文件:SignedData.java   
/**
 * 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);
}
项目:gwt-crypto    文件:SignedData.java   
/**
 * 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);
}
项目:gwt-crypto    文件:AuthenticatedSafe.java   
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);
    }
}
项目:gwt-crypto    文件:ContentInfo.java   
/**
 * 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);
    }
}
项目:gwt-crypto    文件:EnvelopedData.java   
/** 
 * 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);
}
项目:gwt-crypto    文件:TimeStampedData.java   
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);
}
项目:gwt-crypto    文件:MiscTest.java   
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");
        }
    }
}
项目:Aki-SSL    文件:SignedData.java   
/**
 * 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);
}
项目:Aki-SSL    文件:AuthenticatedSafe.java   
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);
    }
}
项目:Aki-SSL    文件:ContentInfo.java   
/**
 * 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);
    }
}
项目:Aki-SSL    文件:EnvelopedData.java   
/** 
 * 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);
}
项目:Aki-SSL    文件:TimeStampedData.java   
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);
}
项目:TinyTravelTracker    文件:SignedData.java   
/**
 * 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);
}
项目:TinyTravelTracker    文件:AuthenticatedSafe.java   
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);
    }
}
项目:TinyTravelTracker    文件:ContentInfo.java   
/**
 * 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);
    }
}
项目:TinyTravelTracker    文件:EnvelopedData.java   
/** 
 * 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);
}
项目:TinyTravelTracker    文件:TimeStampedData.java   
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);
}
项目:TinyTravelTracker    文件:TimeStampedDataParser.java   
/**
 * <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);
}
项目:AcademicTorrents-Downloader    文件:SignedData.java   
/**
 * 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);
}
项目:CryptMeme    文件:SignedData.java   
/**
 * 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);
}
项目:CryptMeme    文件:AuthenticatedSafe.java   
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);
    }
}
项目:CryptMeme    文件:ContentInfo.java   
/**
 * 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);
    }
}
项目:CryptMeme    文件:EnvelopedData.java   
/** 
 * 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);
}
项目:CryptMeme    文件:TimeStampedData.java   
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);
}
项目:CryptMeme    文件:TimeStampedDataParser.java   
/**
 * <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);
}
项目:irma_future_id    文件:SignedData.java   
/**
 * 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);
}
项目:irma_future_id    文件:AuthenticatedSafe.java   
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);
    }
}
项目:irma_future_id    文件:ContentInfo.java   
/**
 * 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);
    }
}
项目:irma_future_id    文件:EnvelopedData.java   
/** 
 * 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);
}
项目:irma_future_id    文件:TimeStampedData.java   
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);
}
项目:irma_future_id    文件:TimeStampedDataParser.java   
/**
 * <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);
}
项目:bc-java    文件:SignedData.java   
/**
 * 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);
}
项目:bc-java    文件:AuthenticatedSafe.java   
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);
    }
}