示例#1
0
 public function getTag()
 {
     if (empty($this->server_config['crypto']['signing_key'])) {
         echo "No keypair found. Keys are generated when you first start your notary.\n";
         echo "\nTry running this first:\n\tasgard notary start\n";
         exit;
     }
     $pubkey = \Sodium::crypto_sign_publickey(\base64_decode($this->server_config['crypto']['signing_key']));
     $tag = 'http';
     if ($this->server_config['tls']['enabled']) {
         $tag .= 's';
     }
     $tag .= '://' . $this->server_config['host'];
     $tag .= ':' . $this->server_config['port'];
     $tag .= '/#';
     $tag .= \urlencode(\base64_encode($pubkey));
     echo $tag . "\n";
 }