11 $baseDir = dirname(dirname(dirname(dirname(__FILE__))));
14 require_once(
$baseDir .
'/lib/_autoload.php');
16 if(!
SimpleSAML\Module::isModuleEnabled(
'metarefresh')) {
17 echo(
"You need to enable the metarefresh module before this script can be used.\n");
18 echo(
"You can enable it by running the following command:\n");
19 echo(
' echo >"' .
$baseDir .
'/modules/metarefresh/enable' .
"\"\n");
55 foreach(
$argv as $a) {
56 if(strlen($a) === 0) {
66 if(strpos($a,
'=') !== FALSE) {
68 $v = substr($a, $p + 1);
69 $a = substr($a, 0, $p);
80 if(array_key_exists($a, $shortOptMap)) {
81 $a = $shortOptMap[$a];
86 if($v === NULL || strlen($v) === 0) {
87 echo(
'The --certficate option requires an parameter.' .
"\n");
88 echo(
'Please run `' .
$progName .
' --help` for usage information.' .
"\n");
93 case '--validate-fingerprint':
94 if($v === NULL || strlen($v) === 0) {
95 echo(
'The --validate-fingerprint option requires an parameter.' .
"\n");
96 echo(
'Please run `' .
$progName .
' --help` for usage information.' .
"\n");
105 if($v === NULL || strlen($v) === 0) {
106 echo(
'The --out-dir option requires an parameter.' .
"\n");
107 echo(
'Please run `' .
$progName .
' --help` for usage information.' .
"\n");
116 echo(
'Unknown option: ' . $a .
"\n");
117 echo(
'Please run `' .
$progName .
' --help` for usage information.' .
"\n");
123 echo(
$progName .
': Missing input files. Please run `' .
$progName .
' --help` for usage information.' .
"\n");
153 echo(
'Usage: ' . $progName .
' [options] [files]' .
"\n");
155 echo(
'This program parses a SAML metadata files and output pieces that can' .
"\n");
156 echo(
'be added to the metadata files in metadata/.' .
"\n");
158 echo(
'Options:' .
"\n");
159 echo(
' --certificate=<FILE> The certificate which should be used' .
"\n");
160 echo(
' to check the signature of the metadata.' .
"\n");
161 echo(
' The file are stored in the cert dir.' .
"\n");
162 echo(
' It is possibility to add multiple' .
"\n");
163 echo(
' --certificate options to handle' .
"\n");
164 echo(
' key rollover.' .
"\n");
165 echo(
' --validate-fingerprint=<FINGERPRINT>' .
"\n");
166 echo(
' Check the signature of the metadata,' .
"\n");
167 echo(
' and check the fingerprint of the' .
"\n");
168 echo(
' certificate against <FINGERPRINT>.' .
"\n");
169 echo(
' -h, --help Print this help.' .
"\n");
170 echo(
' -o=<DIR>, --out-dir=<DIR> Write the output to this directory. The' .
"\n");
171 echo(
' default directory is metadata-generated/.' .
"\n");
172 echo(
' Path will be relative to the SimpleSAMLphp' .
"\n");
173 echo(
' base directory.' .
"\n");
174 echo(
' -s, --stdout Write the output to stdout instead of' .
"\n");
175 echo(
' seperate files in the output directory.' .
"\n");
static setConfigDir($path, $configSet='simplesaml')
Set the directory for configuration files for the given configuration set.
Attribute-related utility methods.