Documentation ¶
Index ¶
- Constants
- Variables
- func GenerateKey(bytesLen int) ([]byte, error)
- type GoEDS
- func (g *GoEDS) Base64Decrypt(keyName string, base64Data string) ([]byte, error)
- func (g *GoEDS) Base64DecryptToString(keyName string, base64Data string) (string, error)
- func (g *GoEDS) Decrypt(keyName string, data []byte) ([]byte, error)
- func (g *GoEDS) DecryptToString(keyName string, data []byte) (string, error)
- func (g *GoEDS) Encrypt(keyName string, plaintext []byte) ([]byte, error)
- func (g *GoEDS) EncryptToBase64(keyName string, plaintext []byte) (string, error)
- func (g *GoEDS) GenerateNewKey(keyName string) error
- func (g *GoEDS) KeyExists(keyName string) bool
- func (g *GoEDS) StringEncrypt(keyName string, stringPlaintext string) ([]byte, error)
- func (g *GoEDS) StringEncryptToBase64(keyName string, stringPlaintext string) (string, error)
- type GoEDSConfig
Constants ¶
View Source
const ( KEY_BYTES_LEN = 32 GCM_NONCE_SIZE = 12 )
Variables ¶
View Source
var (
ErrKeyExists = errors.New("this key already exists")
)
Functions ¶
func GenerateKey ¶
Types ¶
type GoEDS ¶
type GoEDS struct {
// contains filtered or unexported fields
}
func NewFromMasterKeyFile ¶
func NewWithConfig ¶
func NewWithConfig(config GoEDSConfig, gfs *gofs.GoFS) (*GoEDS, error)
func (*GoEDS) Base64Decrypt ¶
decrypt the provided data ("nonce.cipheredtext" from Base64string) and return a bytes result
func (*GoEDS) Base64DecryptToString ¶
decrypt the provided data ("nonce.cipheredtext" from Base64string) and return a string result
func (*GoEDS) Decrypt ¶
decrypt the provided data ("nonce.cipheredtext" from bytes) and return a bytes result
func (*GoEDS) DecryptToString ¶
decrypt the provided data ("nonce.cipheredtext" from bytes) and return a string result
func (*GoEDS) EncryptToBase64 ¶
encrypt the provided data and return a Base64 string result
func (*GoEDS) GenerateNewKey ¶
func (*GoEDS) StringEncrypt ¶
encrypt the provided data (from string) and return a bytes result
type GoEDSConfig ¶
type GoEDSConfig struct {
MasterPassPhrase []byte
}
Click to show internal directories.
Click to hide internal directories.