code: func (ctl *HandshakeController) validKeys(pubkeyid string, topic *Topic, in bool) (validkeys []*string) {
  	ctl.lock.Lock()
  	defer ctl.lock.Unlock()
  	now := time.Now()
  	if _, ok := ctl.handshakes[pubkeyid]; !ok {
  		return []*string{}
  	} else if _, ok := ctl.handshakes[pubkeyid][*topic]; !ok {
  		return []*string{}
  	}
  	var keystore *[]handshakeKey
  	if in {
  		keystore = &(ctl.handshakes[pubkeyid][*topic].inKeys)
  	} else {
  		keystore = &(ctl.handshakes[pubkeyid][*topic].outKeys)
  	}
  
  	for _, key := range *keystore {
  		if key.limit <= key.count {
  			ctl.releaseKeyNoLock(*key.symKeyID, topic)
  		} else if !key.expiredAt.IsZero() && key.expiredAt.Before(now) {
  			ctl.releaseKeyNoLock(*key.symKeyID, topic)
  		} else {
  			validkeys = append(validkeys, key.symKeyID)
  		}
  	}
  	return
  }
docs: // Return all unexpired symmetric keys from store by
  // peer (public key), topic and specified direction