Contents

encryptionStream(appendingTo:encryptionContext:flags:threadCount:)

Reopens an existing encryption sequential output stream.

Declaration

static func encryptionStream(appendingTo encryptedStream: ArchiveByteStream, encryptionContext context: ArchiveEncryptionContext, flags: ArchiveFlags = [], threadCount: Int = 0) -> ArchiveByteStream?

Parameters

  • encryptedStream:

    An input stream that provides encrypted and compressed data. The stream must implement Read(into:) and Read(into:atoffset:).

  • context:

    The encryption context that provides options and credentials.

  • flags:

    Flags that control the behavior of the operation.

  • threadCount:

    The number of worker threads that the operation uses, set to 0 for default.

Return Value

A new archive byte stream.

Discussion

The operation writes encrypted and compressed data to the end of the supplied archive byte stream, encryptedStream.

Create the encryption context from encryptedStream, and add the credentials to unlock the stream before calling this function.

The stream that the function returns only implements read(into:) and read(into:atOffset:).

See Also

Encrypting Data