MMCT TEAM
Server IP : 103.53.40.154  /  Your IP : 18.117.78.87
Web Server : Apache
System : Linux md-in-35.webhostbox.net 4.19.286-203.ELK.el7.x86_64 #1 SMP Wed Jun 14 04:33:55 CDT 2023 x86_64
User : ppcad7no ( 715)
PHP Version : 8.2.25
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : ON
Directory (0755) :  /var/softaculous/ocportal/../mongo/../cumulus/../moodle38/

[  Home  ][  C0mmand  ][  Upload File  ]

Current File : //var/softaculous/ocportal/../mongo/../cumulus/../moodle38/privatekey.php
<?php

// We do not need this file any more
@unlink('privatekey.php');

$ltikey = __mod_lti_verify_private_key();

echo '<kid>'.$ltikey['kid'].'</kid>';
echo '<privatekey>'.$ltikey['privatekey'].'</privatekey>';

function __mod_lti_verify_private_key() {
	global $error;
	
	if (!function_exists('openssl_random_pseudo_bytes')) {
		$error[] = "openssl must be loaded for openssl_random_pseudo_bytes to function";
		return null;
	}
	
	// Create the private key.
	$kid = bin2hex(openssl_random_pseudo_bytes(10));
	
	$config = array(
		"digest_alg" => "sha256",
		"private_key_bits" => 2048,
		"private_key_type" => OPENSSL_KEYTYPE_RSA,
	);
	$res = openssl_pkey_new($config);
	openssl_pkey_export($res, $privatekey);

	return array(
		'kid' => $kid,
		'privatekey' => $privatekey,
	);
}

?>

MMCT - 2023