Documentation
¶
Overview ¶
Package envelope says what protects an encrypted package: the compound file that an encrypted Office document is stored in ([MS-OFFCRYPTO]), and that an XPS document under rights management is stored in too. It is one test for go-fast-ooxml, go-fast-pdf and go-fast-msbin, and one wording of what each library says of a package it does not open.
Nothing is decrypted here. A library that decrypts (go-fast-ooxml, with a password or a private key) does so after Detect says Password.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Message ¶
func Message(p Protection, subject string) string
Message says what a package that is not opened is, for the text of an error; subject names it: "Office document", "package". It is "" for None.
Types ¶
type Protection ¶
type Protection int
Protection is what an envelope says protects the package in it.
const ( // None: the compound file is no envelope. None Protection = iota // RightsManaged: rights management (Information Rights Management). // The key is in a licence that a rights-management server issues to // the people the document names ([MS-OFFCRYPTO] 2.2.11, 2.6). RightsManaged // Password: the EncryptionInfo and EncryptedPackage streams of an // encrypted Office document. The key is made from a password, or held // for the owners of certificates ([MS-OFFCRYPTO] 2.3). Password // Unstated: an envelope (a \x06DataSpaces storage or an // EncryptedPackage stream) that is neither of the others. Unstated )
func Detect ¶
func Detect(f *cfb.File) Protection
Detect says what protects the package f holds. Rights management is known by the streams Office writes (\x09DRMEncryptedDataSpace, \x09DRMEncryptedTransform, \x09DRMContent) and by those the .NET packaging classes write around an XPS document, which name the transform as they like and keep each user's licence beside it, in a stream whose name begins "EUL-".