zdpgo_password_file

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 8, 2022 License: MIT Imports: 8 Imported by: 0

README

zdpgo_password_file

专用于文件加密的组件

版本历史

  • v0.1.0 2022/07/08 新增:文件加密解密

使用示例

请查看 examples 目录

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type File

type File struct {
	Password *zdpgo_password.Password
}

func New

func New() *File

func (*File) AesDump

func (f *File) AesDump(filePath string, jsonObj interface{}) error

AesDump 将json对象加密为文件

func (*File) AesDumpData

func (f *File) AesDumpData(key string, jsonObj interface{}) error

AesDumpData 将json对象加密为并存储

func (*File) AesLoad

func (f *File) AesLoad(filePath string, jsonObj interface{}) error

AesLoad 将密码文件加载为指定对象

func (*File) AesLoadData

func (f *File) AesLoadData(key string, data []byte, jsonObj interface{}) error

AesLoadData 加载字节数据

func (*File) AesUpdate

func (f *File) AesUpdate(filePath string, jsonObj interface{}, newAesKey string) error

AesUpdate 更新加密文件内容

func (*File) AesUpdateData

func (f *File) AesUpdateData(key string, jsonObj interface{}, newAesKey string) error

AesUpdateData 更新加密的数据

func (*File) DecryptFile

func (f *File) DecryptFile(filePath string) error

DecryptFile 解密文件

func (*File) DecryptFileNoChangeName

func (f *File) DecryptFileNoChangeName(filePath string) error

DecryptFileNoChangeName 解密文件且不修改文件名

func (*File) DecryptFileWithEncryptName

func (f *File) DecryptFileWithEncryptName(encryptFilePath string) error

DecryptFileWithEncryptName 根据加密文件名解密文件

func (*File) EncryptFile

func (f *File) EncryptFile(filePath string) error

EncryptFile 加密文件

func (*File) EncryptFileNoChangeName

func (f *File) EncryptFileNoChangeName(filePath string) error

EncryptFileNoChangeName 加密文件且不修改文件名

func (*File) GetEncryptFileName

func (f *File) GetEncryptFileName(filePath string) (encryptFilePath string, encryptFileName string, err error)

GetEncryptFileName 获取加密文件名 @return decryptFilePath 加密文件路径 @return decryptFileName 加密文件文件名

func (*File) ReadEncryptFile

func (f *File) ReadEncryptFile(filePath string) (data []byte, err error)

ReadEncryptFile 读取加密文件的内容

Directories

Path Synopsis
examples
encrypt_decrypt command

Jump to

Keyboard shortcuts

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