Esempio n. 1
0
// Keygens a new ephemeral key, returns the header plus this key.
func prepareNewHeader() (*miniLockv1Header, *taber.Keys, error) {
	hdr := new(miniLockv1Header)
	hdr.Version = 1
	ephem, err := taber.RandomKey()
	if err != nil {
		return nil, nil, err
	}
	hdr.Ephemeral = ephem.Public
	hdr.DecryptInfo = make(map[string][]byte)
	return hdr, ephem, nil
}
Esempio n. 2
0
// Generate a fully random key, usually for ephemeral uses.
func EphemeralKey() (*taber.Keys, error) {
	return taber.RandomKey()
}