Code example for ByteArrayOutputStream

Methods: close, toByteArray, write

0
            sig.update(new DERSequence(pkac).getEncoded(ASN1Encoding.DER));
        } 
        catch (IOException ioe)
        { 
            throw new SignatureException(ioe.getMessage());
        } 
 
        sigBits = sig.sign();
    } 
 
    private ASN1Primitive getKeySpec() throws NoSuchAlgorithmException, 
            InvalidKeySpecException, NoSuchProviderException 
    { 
        ByteArrayOutputStream baos = new ByteArrayOutputStream();
 
        ASN1Primitive obj = null;
        try 
        { 
 
            baos.write(pubkey.getEncoded());
            baos.close();