function legacy(fs) {
        return {
          ReadStream: ReadStream,
          WriteStream: WriteStream
        }

        function ReadStream(path, options) {
          if (!(this instanceof ReadStream)) return new ReadStream(path, options)

          Stream.call(this)

          var self = this

          this.path = path
          this.fd = null
          this.readable = true
          this.paused = false

          this.flags = 'r'
          this.mode = 438 /*=0666*/
          this.bufferSize = 64 * 1024

          options = options || {}

          // Mixin options into this
          var keys = Object.keys(options)
          for (var index = 0, length = keys.length; index < length; index++) {
            var key = keys[index]
            this[key] = options[key]
          }

          if (this.encoding) this.setEncoding(this.encoding)

          if (this.start !== undefined) {
            if ('number' !== typeof this.start) {
              throw TypeError('start must be a Number')
            }
            if (this.end === undefined) {
              this.end = Infinity
            } else if ('number' !== typeof this.end) {
              throw TypeError('end must be a Number')
            }

            if (this.start > this.end) {
              throw new Error('start must be <= end')
            }

            this.pos = this.start
          }

          if (this.fd !== null) {
            process.nextTick(function() {
              self._read()
            })
            return
          }

          fs.open(this.path, this.flags, this.mode, function(err, fd) {
            if (err) {
              self.emit('error', err)
              self.readable = false
              return
            }

            self.fd = fd
            self.emit('open', fd)
            self._read()
          })
        }

        function WriteStream(path, options) {
          if (!(this instanceof WriteStream)) return new WriteStream(path, options)

          Stream.call(this)

          this.path = path
          this.fd = null
          this.writable = true

          this.flags = 'w'
          this.encoding = 'binary'
          this.mode = 438 /*=0666*/
          this.bytesWritten = 0

          options = options || {}

          // Mixin options into this
          var keys = Object.keys(options)
          for (var index = 0, length = keys.length; index < length; index++) {
            var key = keys[index]
            this[key] = options[key]
          }

          if (this.start !== undefined) {
            if ('number' !== typeof this.start) {
              throw TypeError('start must be a Number')
            }
            if (this.start < 0) {
              throw new Error('start must be >= zero')
            }

            this.pos = this.start
          }

          this.busy = false
          this._queue = []

          if (this.fd === null) {
            this._open = fs.open
            this._queue.push([this._open, this.path, this.flags, this.mode, undefined])
            this.flush()
          }
        }
      }
Adds an 'Authorization' header to an http.ClientRequest object.

Note that this API will add a Date header if it's not already set. Any
other headers in the options.headers array MUST be present, or this
will throw.

You shouldn't need to check the return type; it's just there if you want
to be pedantic.

The optional flag indicates whether parsing should use strict enforcement
of the version draft-cavage-http-signatures-04 of the spec or beyond.
The default is to be loose and support
older versions for compatibility.

@param {Object} request an instance of http.ClientRequest.
@param {Object} options signing parameters object:
                  - {String} keyId required.
                  - {String} key required (either a PEM or HMAC key).
                  - {Array} headers optional; defaults to ['date'].
                  - {String} algorithm optional (unless key is HMAC);
                             default is the same as the sshpk default
                             signing algorithm for the type of key given
                  - {String} httpVersion optional; defaults to '1.1'.
                  - {Boolean} strict optional; defaults to 'false'.
@return {Boolean} true if Authorization (and optionally Date) were added.
@throws {TypeError} on bad parameter types (input).
@throws {InvalidAlgorithmError} if algorithm was bad or incompatible with
                                the given key.
@throws {sshpk.KeyParseError} if key was bad.
@throws {MissingHeaderError} if a header to be signed was specified but
                             was not present.