Documentation ¶
Index ¶
Constants ¶
Variables ¶
View Source
var ( AlgorithmErr = errors.New("unsupported algorithm") PassphraseErr = errors.New("wrong passphrase") MACError = errors.New("message authentication failed") UnknownVersionError = errors.New("unknown version") )
View Source
var ( V1 = &version1{ iterations: 1000, hashAlg: sha256.New, saltSize: 12, keySize: 32, nonceSize: 12, } )
Functions ¶
This section is empty.
Types ¶
type Version ¶
type Version interface { Encrypt(plaintext, passphrase []byte, algorithm Algorithm) ([]byte, error) Decrypt(ciphertext, passphrase []byte, algorithm Algorithm) ([]byte, error) StreamEncrypt(src io.Reader, dst io.Writer, passphrase []byte, algorithm Algorithm) error StreamDecrypt(src io.Reader, dst io.Writer, passphrase []byte, algorithm Algorithm) error Sign(digest, privateKey []byte, algorithm Algorithm) ([]byte, error) Verify(signature, digest, publicKey []byte, algorithm Algorithm) (bool, error) }
func LookupVersion ¶
Click to show internal directories.
Click to hide internal directories.