File indexing completed on 2024-06-23 05:14:10

0001 /*  smartcard/keypairinfo.h
0002 
0003     This file is part of Kleopatra, the KDE keymanager
0004     SPDX-FileCopyrightText: 2020 g10 Code GmbH
0005     SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
0006 
0007     SPDX-License-Identifier: GPL-2.0-or-later
0008 */
0009 #pragma once
0010 
0011 #include <string>
0012 
0013 namespace Kleo
0014 {
0015 namespace SmartCard
0016 {
0017 struct KeyPairInfo {
0018     static KeyPairInfo fromStatusLine(const std::string &s);
0019 
0020     bool canAuthenticate() const;
0021     bool canCertify() const;
0022     bool canEncrypt() const;
0023     bool canSign() const;
0024 
0025     void update(const KeyPairInfo &other);
0026 
0027     bool operator==(const KeyPairInfo &other) const;
0028     bool operator!=(const KeyPairInfo &other) const;
0029 
0030     std::string keyRef;
0031     std::string grip;
0032     std::string usage;
0033     std::string keyTime;
0034     std::string algorithm;
0035 };
0036 } // namespace Smartcard
0037 } // namespace Kleopatra