src/Core/WebSocket.php
public static function getToken($launch) {
        global $CFG;
        if ( ! isset($CFG->websocket_secret) || strlen($CFG->websocket_secret) < 1 ) return false;
        $plain = self::makeToken($launch);
        if ( ! $plain ) return $plain;
        $encrypted = AesCtr::encrypt($plain, $CFG->websocket_secret, 256) ;
        return $encrypted;
    }
public static function getToken($launch) {
        global $CFG;
        if ( ! isset($CFG->websocket_secret) || strlen($CFG->websocket_secret) < 1 ) return false;
        $plain = self::makeToken($launch);
        if ( ! $plain ) return $plain;
        $encrypted = AesCtr::encrypt($plain, $CFG->websocket_secret, 256) ;
        return $encrypted;
    }
public static function getToken ( $ launch ) { global $ CFG ; if ( ! isset ( $ CFG -> websocket_secret ) || strlen ( $ CFG -> websocket_secret ) < 1 ) return false ; $ plain = self :: makeToken ( $ launch ) ; if ( ! $ plain ) return $ plain ; $ encrypted = AesCtr :: encrypt ( $ plain , $ CFG -> websocket_secret , 256 ) ; return $ encrypted ; }
Build and sign a token for a particular link_id

@param string $launch The LTI launch object

@return string The encrypted token or false if we cannot make a token
Build and sign a token for a particular link_id