Documentation ¶
Overview ¶
Package crypto provides PDF encryption plumbing code.
Index ¶
- func DecryptDeepObject(objIn interface{}, objNr, genNr int, key []byte, aes bool) (*types.PDFStringLiteral, error)
- func DecryptStream(needAES bool, buf []byte, objNr, genNr int, key []byte) ([]byte, error)
- func DecryptString(needAES bool, s string, objNr, genNr int, key []byte) (*string, error)
- func EncryptDeepObject(objIn interface{}, objNr, genNr int, key []byte, aes bool) (*types.PDFStringLiteral, error)
- func EncryptStream(needAES bool, buf []byte, objNr, genNr int, key []byte) ([]byte, error)
- func EncryptString(needAES bool, s string, objNr, genNr int, key []byte) (*string, error)
- func HasNeededPermissions(enc *types.Enc) bool
- func ID(ctx *types.PDFContext) *types.PDFArray
- func O(ctx *types.PDFContext) ([]byte, error)
- func SupportedCFEntry(d *types.PDFDict) (bool, bool)
- func SupportedEncryption(ctx *types.PDFContext, dict *types.PDFDict) (*types.Enc, error)
- func U(ctx *types.PDFContext) (u []byte, key []byte, err error)
- func ValidateOwnerPassword(ctx *types.PDFContext) (ok bool, err error)
- func ValidateUserPassword(ctx *types.PDFContext) (ok bool, key []byte, err error)
- func Verbose(verbose bool)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecryptDeepObject ¶
func DecryptDeepObject(objIn interface{}, objNr, genNr int, key []byte, aes bool) (*types.PDFStringLiteral, error)
DecryptDeepObject recurses over non trivial PDF objects and decrypts all strings encountered.
func DecryptStream ¶
DecryptStream decrypts a stream buffer using RC4 or AES.
func DecryptString ¶
DecryptString decrypts s using RC4 or AES.
func EncryptDeepObject ¶
func EncryptDeepObject(objIn interface{}, objNr, genNr int, key []byte, aes bool) (*types.PDFStringLiteral, error)
EncryptDeepObject recurses over non trivial PDF objects and encrypts all strings encountered.
func EncryptStream ¶
EncryptStream encrypts a stream buffer using RC4 or AES.
func EncryptString ¶
EncryptString encrypts s using RC4 or AES.
func HasNeededPermissions ¶
HasNeededPermissions returns true if permissions for pdfcpu processing are present.
func ID ¶ added in v0.1.1
func ID(ctx *types.PDFContext) *types.PDFArray
ID generates the ID element for this file.
func O ¶ added in v0.1.1
func O(ctx *types.PDFContext) ([]byte, error)
O calculates the owner password digest.
func SupportedCFEntry ¶
SupportedCFEntry returns true if all entries found are supported.
func SupportedEncryption ¶
SupportedEncryption returns true if used encryption is supported by pdfcpu.
func U ¶ added in v0.1.1
func U(ctx *types.PDFContext) (u []byte, key []byte, err error)
U calculates the user password digest.
func ValidateOwnerPassword ¶
func ValidateOwnerPassword(ctx *types.PDFContext) (ok bool, err error)
ValidateOwnerPassword validates ownerpw.
func ValidateUserPassword ¶
func ValidateUserPassword(ctx *types.PDFContext) (ok bool, key []byte, err error)
ValidateUserPassword validates userpw.
Types ¶
This section is empty.