Documentation
¶
Overview ¶
Package ampoule is a demo auth-HPKE file format.
It's similar to pgp I suppose.
The alternative is Cheese - https://codeberg.org/risottobias/cheese
Index ¶
- Constants
- Variables
- func Gen() (kem.PublicKey, kem.PrivateKey, error)
- func KeyToLine(k []byte, t keytype) ([]byte, error)
- func LineToKey(k []byte, t keytype) ([]byte, error)
- func LoadPrivate(lbytes []byte, passphrase string) (kem.PrivateKey, error)
- func LoadPrivateFile(ident, passphrase string) (kem.PrivateKey, error)
- func LoadPublic(fbytes []byte) (kem.PublicKey, error)
- func LoadPublicFile(ident string) (kem.PublicKey, error)
- func Recv(message []byte, from kem.PublicKey, to kem.PrivateKey) ([]byte, error)
- func SavePrivate(priv kem.PrivateKey, passphrase string) ([]byte, error)
- func SavePrivateFile(priv kem.PrivateKey, ident, passphrase string) error
- func SavePublic(pub kem.PublicKey) ([]byte, error)
- func SavePublicFile(pub kem.PublicKey, ident string) error
- func Send(message []byte, from kem.PrivateKey, to kem.PublicKey) ([]byte, error)
Constants ¶
const ( // Not sure about this KEM KemID = hpke.KEM_P384_HKDF_SHA384 // *shrug* I dunno KdfID = hpke.KDF_HKDF_SHA384 AeadID = hpke.AEAD_AES256GCM )
Fixing the auth type and scheme (could change to a P256...)
Variables ¶
var AmpouleSuite hpke.Suite
Not positive about this suite. it's from the demo code.
var PublicInfo []byte
PublicInfo could encode the version string. who knows. For now, a self-referential string.
Functions ¶
func LoadPrivate ¶
func LoadPrivate(lbytes []byte, passphrase string) (kem.PrivateKey, error)
LoadPrivate reads a kem.PrivateKey from a string
func LoadPrivateFile ¶
func LoadPrivateFile(ident, passphrase string) (kem.PrivateKey, error)
LoadPrivateFile reads a kem.PrivateKey from {ident}.key (wraps LoadPrivate)
func LoadPublic ¶
LoadPublic reads a kem.PublicKey from a string
func LoadPublicFile ¶
LoadPublicFile reads a kem.PublicKey from {ident}.pub (wraps LoadPublic)
func SavePrivate ¶
func SavePrivate(priv kem.PrivateKey, passphrase string) ([]byte, error)
SavePrivate encrypts a kem to a safe line and returns that string
func SavePrivateFile ¶
func SavePrivateFile(priv kem.PrivateKey, ident, passphrase string) error
SavePrivateFile writes a kem.PrivateKey to {ident}.key (wraps SavePrivate)
func SavePublic ¶
SavePublic writes a kem.PublicKey to string
func SavePublicFile ¶
SavePublic writes a kem.PublicKey to {ident}.pub (wraps SavePublic)
Types ¶
This section is empty.