crypto

package
v0.0.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 10, 2017 License: MIT Imports: 12 Imported by: 0

Documentation

Index

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

func DecryptStream(needAES bool, buf []byte, objNr, genNr int, key []byte) ([]byte, error)

DecryptStream decrypts a stream buffer using RC4 or AES.

func DecryptString

func DecryptString(needAES bool, s string, objNr, genNr int, key []byte) (*string, error)

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

func EncryptStream(needAES bool, buf []byte, objNr, genNr int, key []byte) ([]byte, error)

EncryptStream encrypts a stream buffer using RC4 or AES.

func EncryptString

func EncryptString(needAES bool, s string, objNr, genNr int, key []byte) (*string, error)

EncryptString encrypts s using RC4 or AES.

func HasNeededPermissions

func HasNeededPermissions(enc *Encrypt) bool

HasNeededPermissions returns true if permissions for pdfcpu processing are present.

func SupportedCFEntry

func SupportedCFEntry(d *types.PDFDict) (bool, bool)

SupportedCFEntry returns true if all entries found entries are suppoerted.

func ValidateOwnerPassword

func ValidateOwnerPassword(ownerpw, userpw string, e *Encrypt, id []byte) (ok bool, err error)

ValidateOwnerPassword validates ownerpw.

func ValidateUserPassword

func ValidateUserPassword(userpw string, e *Encrypt, id []byte) (ok bool, key []byte, err error)

ValidateUserPassword validates userpw.

func Verbose

func Verbose(verbose bool)

Verbose controls logging output.

Types

type Encrypt

type Encrypt struct {
	// contains filtered or unexported fields
}

Encrypt wraps around all defined encryption attributes.

func SupportedEncryption

func SupportedEncryption(ctx *types.PDFContext, dict *types.PDFDict) (*Encrypt, error)

SupportedEncryption returns true if used encryption is supported by pdfcpu.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL