1<?php 2namespace IMSGlobal\LTI; 3 4class LTI_Registration { 5 6 private $issuer; 7 private $client_id; 8 private $key_set_url; 9 private $auth_token_url; 10 private $auth_login_url; 11 private $auth_server; 12 private $tool_private_key; 13 private $kid; 14 15 public static function new() { 16 return new LTI_Registration(); 17 } 18 19 public function get_issuer() { 20 return $this->issuer; 21 } 22 23 public function set_issuer($issuer) { 24 $this->issuer = $issuer; 25 return $this; 26 } 27 28 public function get_client_id() { 29 return $this->client_id; 30 } 31 32 public function set_client_id($client_id) { 33 $this->client_id = $client_id; 34 return $this; 35 } 36 37 public function get_key_set_url() { 38 return $this->key_set_url; 39 } 40 41 public function set_key_set_url($key_set_url) { 42 $this->key_set_url = $key_set_url; 43 return $this; 44 } 45 46 public function get_auth_token_url() { 47 return $this->auth_token_url; 48 } 49 50 public function set_auth_token_url($auth_token_url) { 51 $this->auth_token_url = $auth_token_url; 52 return $this; 53 } 54 55 public function get_auth_login_url() { 56 return $this->auth_login_url; 57 } 58 59 public function set_auth_login_url($auth_login_url) { 60 $this->auth_login_url = $auth_login_url; 61 return $this; 62 } 63 64 public function get_auth_server() { 65 return empty($this->auth_server) ? $this->auth_token_url : $this->auth_server; 66 } 67 68 public function set_auth_server($auth_server) { 69 $this->auth_server = $auth_server; 70 return $this; 71 } 72 73 public function get_tool_private_key() { 74 return $this->tool_private_key; 75 } 76 77 public function set_tool_private_key($tool_private_key) { 78 $this->tool_private_key = $tool_private_key; 79 return $this; 80 } 81 82 public function get_kid() { 83 return empty($this->kid) ? hash('sha256', trim($this->issuer . $this->client_id)) : $this->kid; 84 } 85 86 public function set_kid($kid) { 87 $this->kid = $kid; 88 return $this; 89 } 90 91} 92 93?>