// create a new GroupChannel and initialize it with the self key
create a new GroupChannel and initialize it with the self key
// create a new GroupChannel and initialize it with the self key
func (p *Protocol) CreateGroupChannel(gid string, cipher mls.CipherSuite) (*GroupChannel, error) {
	channel, err := NewGroupChannel(p, gid, cipher)
	if err != nil {
		return nil, err
	}
	if p.uik == nil {
		return nil, ErrKeyNotFound	
	}
	privKey := p.getPrivateKey(p.uik, cipher)
	if privKey == nil {
		return nil, ErrKeyNotFound
	}
	if err := channel.Initialize(privKey, p.uik.IdentityKey); err != nil {	
		return nil, err
	}
	if err := channel.RegisterGIK(); err != nil {
		return nil, err
	}
	p.channels[gid] = channel
	return channel, nil
}
func ( p * Protocol ) CreateGroupChannel ( gid string , cipher mls . CipherSuite ) ( * GroupChannel , error ) { channel , err := NewGroupChannel ( p , gid , cipher ) if err != nil { return nil , err } if p . uik == nil { return nil , ErrKeyNotFound } privKey := p . getPrivateKey ( p . uik , cipher ) if privKey == nil { return nil , ErrKeyNotFound } if err := channel . Initialize ( privKey , p . uik . IdentityKey ) ; err != nil { return nil , err } if err := channel . RegisterGIK ( ) ; err != nil { return nil , err } p . channels [ gid ] = channel return channel , nil }
create a new GroupChannel and initialize it with the self key
create a new GroupChannel and initialize it with the self key
// not finished Connect()?? // this uik must be the one on the directory // register the GIK as we just created a new group