Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/C/Threema/ThreemaFramework/Business/   (Social Medium ©)  Datei vom 26.9.2026 mit Größe 1 kB image not shown  

Quelle  RevocationKeyManager.swift   Sprache: JAVA

 

import Foundation
import ThreemaMacros

public final class RevocationKeyManager {
    
    public static let shared = RevocationKeyManager()
    
    let businessInjector: BusinessInjectorProtocol
    let connector = ServerAPIConnector()

    // MARK: - Lifecycle

    private init(businessInjector: BusinessInjectorProtocol = BusinessInjector()) {
        self.businessInjector = businessInjector
    }
    
    // MARK: - Public func

    public func setPassword(_ password: String) {
        let myIdentityStore = businessInjector.myIdentityStore
        
        connector.setRevocationPassword(password, for: myIdentityStore) {
            myIdentityStore.revocationPasswordLastCheck = nil
            NotificationPresenterWrapper.shared.present(type: .revocationPasswordSuccess)
            NotificationCenter.default.post(name: NSNotification.Name(kRevocationPasswordUIRefresh), object: nil)
        } onError: { _ in
            NotificationPresenterWrapper.shared.present(type: .revocationPasswordError)
            NotificationCenter.default.post(name: NSNotification.Name(kRevocationPasswordUIRefresh), object: nil)
        }
    }
    
    public func checkPasswordSetDate(completion: @escaping () -> Void) {
        let myIdentityStore = businessInjector.myIdentityStore
        
        guard myIdentityStore.revocationPasswordLastCheck == nil else {
            return
        }
        
        connector.checkRevocationPassword(for: myIdentityStore) { _, onDate in
            if let onDate {
                myIdentityStore.revocationPasswordLastCheck = Date.now
                myIdentityStore.revocationPasswordSetDate = onDate
            }
            else {
                myIdentityStore.revocationPasswordLastCheck = nil
                myIdentityStore.revocationPasswordSetDate = nil
            }
            completion()
        } onError: { _ in
            myIdentityStore.revocationPasswordLastCheck = nil
            myIdentityStore.revocationPasswordSetDate = nil
            completion()
        }
    }
}

Messung
CHZG
839510092

¤ Dauer der Verarbeitung: 0.0 Sekunden  (vorverarbeitet am  2026-11-04) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover


Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.