Example usage for org.bouncycastle.asn1 BEROctetStringGenerator getOctetOutputStream

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

Introduction

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

Prototype

public OutputStream getOctetOutputStream(byte[] buf) 

Source Link

Document

Return a stream representing the content target for this OCTET STRING

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]);
    }//  w  w w .  j a  v  a 2  s . c  o m
    return octGen.getOctetOutputStream();
}