// NewIdent creates a new DHT identity and generates a new keypair for it. func NewIdent() (*Ident, error) { publicKey, secretKey, err := crypto.GenerateKeyPair() if err != nil { return nil, err } inst := &Ident{ PublicKey: publicKey, SecretKey: secretKey, } return inst, nil }
func NewConnection() (*Connection, error) { publicKey, secretKey, err := crypto.GenerateKeyPair() if err != nil { return nil, err } conn := &Connection{ PublicKey: publicKey, SecretKey: secretKey, verified: false, } return conn, nil }