1cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved.
2cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be
3cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// found in the LICENSE file.
4cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
5cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#ifndef CRYPTO_OPENSSL_BIO_STRING_H_
6cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#define CRYPTO_OPENSSL_BIO_STRING_H_
7cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
8cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#include <string>
9cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
10cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#include "crypto/crypto_export.h"
11cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
12cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// From <openssl/bio.h>
13cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)typedef struct bio_st BIO;
14cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
15cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)namespace crypto {
16cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
17cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// Creates a new BIO that can be used with OpenSSL's various output functions,
18cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// and which will write all output directly into |out|. This is primarily
19cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// intended as a utility to reduce the amount of copying and separate
20cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// allocations when performing extensive string modifications or streaming
21cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// within OpenSSL.
22cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)//
23cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)// Note: |out| must remain valid for the duration of the BIO.
24cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)CRYPTO_EXPORT BIO* BIO_new_string(std::string* out);
25cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
26cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)}  // namespace crypto
27cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
28cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)#endif  // CRYPTO_OPENSSL_BIO_STRING_H_
29cedac228d2dd51db4b79ea1e72c7f249408ee061Torne (Richard Coles)
30