Example usage for org.bouncycastle.asn1 BEROctetStringGenerator BEROctetStringGenerator

List of usage examples for org.bouncycastle.asn1 BEROctetStringGenerator BEROctetStringGenerator

Introduction

In this page you can find the example usage for org.bouncycastle.asn1 BEROctetStringGenerator BEROctetStringGenerator.

Prototype

public BEROctetStringGenerator(OutputStream out, int tagNo, boolean isExplicit) throws IOException 

Source Link

Document

Use the passed in stream as the target for the generator, writing out the header tag for a tagged constructed OCTET STRING (possibly implicit).

Usage

From source file:org.votingsystem.signature.util.CMSUtils.java

License:Open Source License

static OutputStream createBEROctetOutputStream(OutputStream s, int tagNo, boolean isExplicit, int bufferSize)
        throws IOException {
    BEROctetStringGenerator octGen = new BEROctetStringGenerator(s, tagNo, isExplicit);
    if (bufferSize != 0) {
        return octGen.getOctetOutputStream(new byte[bufferSize]);
    }//from   w  w  w .ja va 2s .com
    return octGen.getOctetOutputStream();
}