pdfs

package
v0.0.0-...-89235d8 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2024 License: MIT Imports: 28 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AESDecryptBytes

func AESDecryptBytes(ciphertext []byte, password string) ([]byte, error)

func AESEncryptBytes

func AESEncryptBytes(plaintext []byte, pw string) ([]byte, error)

func DecryptWithPrivateKey

func DecryptWithPrivateKey(ct []byte, priv *rsa.PrivateKey) ([]byte, error)

func EncryptPDF

func EncryptPDF(path string, userPW string) error

func EncryptPDFDirectory

func EncryptPDFDirectory(p string, pw string) error

func EncryptWithPublicKey

func EncryptWithPublicKey(msg []byte, pub *rsa.PublicKey) ([]byte, error)

func GenerateIndex

func GenerateIndex(root string) error

func GetCert

func GetCert() (*x509.Certificate, error)

func GetKey

func GetKey(password string, salt []byte) ([]byte, []byte, error)

func GetPDFPassword

func GetPDFPassword(pw []byte) (string, error)

func GetPDFSizes

func GetPDFSizes() (map[string]int64, error)

func GetPassword

func GetPassword() (string, error)

func GetPrivateKey

func GetPrivateKey(password string) (*rsa.PrivateKey, error)

func GetReadSeeker

func GetReadSeeker(file *os.File) *bytes.Reader

func IsEarly

func IsEarly(cert *x509.Certificate) bool

func IsExpired

func IsExpired(cert *x509.Certificate) bool

func LoadIndex

func LoadIndex() (*searchtree.BinarySearchTree, error)

func PasswordPrompt

func PasswordPrompt() (*string, error)

func PrepareAES

func PrepareAES(key []byte) (cipher.AEAD, error)

func PromptUser

func PromptUser(save bool) (string, error)

func SaveCert

func SaveCert(keypath string, c X509) error

func SaveEncryptionFiles

func SaveEncryptionFiles(password string) error

func SaveFile

func SaveFile(path string, content *bytes.Buffer) error

Types

type X509

type X509 struct {
	Certificate *bytes.Buffer
	PrivateKey  *bytes.Buffer
	PublicKey   *rsa.PublicKey
	Password    string
}

func GenerateCert

func GenerateCert(pw string) (X509, error)

Jump to

Keyboard shortcuts

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