+ if ($keypair === false) {
+ // For debugging clarity. Keypair did not pass count()-check above.
+ // TRANS: Exception when public key was not properly formatted.
+ throw new Exception(_m('Incorrectly formatted public key element.'));
+ }
+
+ $magicsig = Magicsig::fromString($keypair);
+ if (!$magicsig instanceof Magicsig) {
+ common_debug('Salmon error: unable to parse keypair: '.var_export($keypair,true));
+ // TRANS: Exception when public key was properly formatted but not parsable.
+ throw new ServerException(_m('Retrieved Salmon keypair could not be parsed.'));