     
 }
 
+fileprivate extension String {
+    
+    func fromBase64() -> String? {
+        guard let data = Data(base64Encoded: self) else {
+            return nil
+        }
+        
+        return String(data: data, encoding: .utf8)
+    }
+    
+    func toBase64() -> String {
+        return Data(self.utf8).base64EncodedString()
+    }
+}
+
 extension PushyClient{
     enum Status{
                 case success

 */


public struct PushyConf{
    fileprivate let host:String
    fileprivate let port:UInt16
    fileprivate let deviceId:String
    fileprivate let clientId:String
    fileprivate let user:String?
    fileprivate let pass:String?
    fileprivate let isSSL:Bool
    fileprivate let certName:String?
    fileprivate let certPass:String?
    
    public init(host:String,port:UInt16,deviceId:String,clientId client:String,
         user:String? = nil,password pass:String? = nil,
         isSSL:Bool=false,certificateName certName:String? = nil,
         certificatePassword certPass:String? = nil){
        
        self.host       = host;
        self.port       = port;
        self.deviceId   = deviceId;
        self.clientId   = client;
        self.user       = user;
        self.pass       = pass;
        self.isSSL      = isSSL;
        self.certName   = certName;
        self.certPass   = certPass;
        
    }
}

    public func unsubscribe(clientId: String){
        pushSvc.unsubscribe(topic: notificationTopic(clientId: clientId))
    }
    */
    @objc private func fireUpdateWhenNotified(notification:NSNotification){
        
        if let payload = notification.object as? (deviceId:String,clientId:String,host:String){
