Documentation ¶
Index ¶
- Constants
- func AlgoForKey(key []byte) (algorithm, error)
- func Decrypt(key []byte, cipherText []byte) ([]byte, error)
- func Encrypt(key []byte, data []byte) ([]byte, error)
- func EncryptedToPem(algo algorithm, data []byte) []byte
- func GetEncyptedData(data []byte) ([]byte, algorithm)
- func KeyFromAny(k interface{}) ([]byte, error)
- func KeyFromPem(data []byte) ([]byte, error)
- func KeyToPem(data []byte) []byte
- func NewKey(t algorithm) ([]byte, error)
- func OptionalDecrypt(key []byte, data []byte) ([]byte, error)
- func ReadKey(path string, fss ...vfs.FileSystem) ([]byte, error)
- func WriteKey(key []byte, path string, fss ...vfs.FileSystem) error
Constants ¶
View Source
const ( PEM_ENCRYPTION_KEY = "ENCRYPTION KEY" PEM_ENCRYPTED_DATA = "ENCRYPTED DATA" )
View Source
const ( AES_128 = algorithm(16) AES_192 = algorithm(24) AES_256 = algorithm(32) )
View Source
const ( ALGO_AES_128 = "AES-128" ALGO_AES_192 = "AES-192" ALGO_AES_256 = "AES-256" )
View Source
const ALGO = "algorithm"
Variables ¶
This section is empty.
Functions ¶
func AlgoForKey ¶
func EncryptedToPem ¶
func GetEncyptedData ¶
func KeyFromAny ¶
func KeyFromPem ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.