Table of Contents

Method IsEncryptedPackage

Namespace
DocWright.Cryptography
Assembly
DocWright.Cryptography.dll

IsEncryptedPackage(Stream)

Determines whether a stream is an encrypted Office package: a compound file carrying both the EncryptionInfo and EncryptedPackage streams.

Requiring both is what keeps this from claiming an encrypted legacy .doc, which is also a compound file but stores its content in WordDocument and has no EncryptedPackage at all.

public static bool IsEncryptedPackage(Stream stream)

Parameters

stream Stream

A seekable stream. Its position is restored before returning.

Returns

bool

true when the stream is an encrypted Office package.

Exceptions

ArgumentNullException

stream is null.

ArgumentException

stream is not seekable.