Add a new CLI option to the sysadm server:

"-import_ssl_key <user> <key> <nickname> [<email>]": This will add the designated key (file path or raw text) to the SSL keys available for authentication to the server.
This commit is contained in:
Ken Moore
2016-05-17 12:42:14 -04:00
parent e2382280cb
commit a81ca75519
3 changed files with 24 additions and 0 deletions

View File

@@ -86,6 +86,13 @@ bool AuthorizationManager::RegisterCertificate(QString token, QString pubkey, QS
CONFIG->setValue("RegisteredCerts/"+user+"/"+pubkey, "Nickname: "+nickname+"\nEmail: "+email+"\nDate Registered: "+QDateTime::currentDateTime().toString(Qt::ISODate) );
return true;
}
//
bool AuthorizationManager::RegisterCertificateInternal(QString user, QByteArray pubkey, QString nickname, QString email){
pubkey = pubkey.toBase64();
//NOTE: The public key should be saved as a base64 encoded string
CONFIG->setValue("RegisteredCerts/"+user+"/"+pubkey, "Nickname: "+nickname+"\nEmail: "+email+"\nDate Registered: "+QDateTime::currentDateTime().toString(Qt::ISODate) );
return true;
}
bool AuthorizationManager::RevokeCertificate(QString token, QString key, QString user){
//user will be the current user if not empty - cannot touch other user's certs without full perms on current session