anope- supernets anope source code & configuration |
git clone git://git.acid.vegas/anope.git |
Log | Files | Refs | Archive | README |
ns_cert.h (1945B)
1 /* NickServ core functions 2 * 3 * (C) 2003-2022 Anope Team 4 * Contact us at team@anope.org 5 * 6 * Please read COPYING and README for further details. 7 * 8 * Based on the original code of Epona by Lara. 9 * Based on the original code of Services by Andy Church. 10 */ 11 12 struct NSCertList 13 { 14 protected: 15 NSCertList() { } 16 public: 17 virtual ~NSCertList() { } 18 19 /** Add an entry to the nick's certificate list 20 * 21 * @param entry The fingerprint to add to the cert list 22 * 23 * Adds a new entry into the cert list. 24 */ 25 virtual void AddCert(const Anope::string &entry) = 0; 26 27 /** Get an entry from the nick's cert list by index 28 * 29 * @param entry Index in the certificate list vector to retrieve 30 * @return The fingerprint entry of the given index if within bounds, an empty string if the vector is empty or the index is out of bounds 31 * 32 * Retrieves an entry from the certificate list corresponding to the given index. 33 */ 34 virtual Anope::string GetCert(unsigned entry) const = 0; 35 36 virtual unsigned GetCertCount() const = 0; 37 38 /** Find an entry in the nick's cert list 39 * 40 * @param entry The fingerprint to search for 41 * @return True if the fingerprint is found in the cert list, false otherwise 42 * 43 * Search for an fingerprint within the cert list. 44 */ 45 virtual bool FindCert(const Anope::string &entry) const = 0; 46 47 /** Erase a fingerprint from the nick's certificate list 48 * 49 * @param entry The fingerprint to remove 50 * 51 * Removes the specified fingerprint from the cert list. 52 */ 53 virtual void EraseCert(const Anope::string &entry) = 0; 54 55 /** Clears the entire nick's cert list 56 * 57 * Deletes all the memory allocated in the certificate list vector and then clears the vector. 58 */ 59 virtual void ClearCert() = 0; 60 61 virtual void Check() = 0; 62 }; 63 64 class CertService : public Service 65 { 66 public: 67 CertService(Module *c) : Service(c, "CertService", "certs") { } 68 69 virtual NickCore* FindAccountFromCert(const Anope::string &cert) = 0; 70 };