libzypp 17.34.0
KeyManager.h
Go to the documentation of this file.
1/*---------------------------------------------------------------------\
2| ____ _ __ __ ___ |
3| |__ / \ / / . \ . \ |
4| / / \ V /| _/ _/ |
5| / /__ | | | | | | |
6| /_____||_| |_| |_| |
7| |
8\---------------------------------------------------------------------*/
12#ifndef ZYPP_KEYMANAGER_H
13#define ZYPP_KEYMANAGER_H
14
15#include <zypp/base/PtrTypes.h>
16#include <zypp/Pathname.h>
17#include <zypp/PublicKey.h>
18#include <zypp-core/ByteArray.h>
19
20#include <memory>
21
22namespace zypp
23{
24
33{
34 public:
46
55
57 Pathname homedir() const;
58
60 std::list<PublicKeyData> listKeys();
61
63 std::list<PublicKeyData> readKeyFromFile(const Pathname & file);
64
66 bool verify(const Pathname & file, const Pathname & signature);
67
69 bool exportKey(const std::string & id, std::ostream & stream);
70
72 bool importKey(const Pathname & keyfile);
73
75 bool importKey(const ByteArray & keydata);
76
78 bool deleteKey (const std::string & id);
79
81 std::list<std::string> readSignatureFingerprints(const Pathname & signature);
82
84 std::list<std::string> readSignatureFingerprints( const ByteArray & keyData );
85
86 private:
88
89 class Impl;
91};
92
93}
94
95
96#endif
Reference counted access to a Tp object calling a custom Dispose function when the last AutoDispose h...
Definition AutoDispose.h:95
bool exportKey(const std::string &id, std::ostream &stream)
Exports the key with id into the given stream, returns true on success.
std::list< PublicKeyData > listKeys()
Returns a list of all public keys found in the current keyring.
bool verify(const Pathname &file, const Pathname &signature)
Tries to verify file using signature, returns true on success.
static KeyManagerCtx createForOpenPGP()
Creates a new KeyManagerCtx for PGP using a volatile temp.
std::list< std::string > readSignatureFingerprints(const Pathname &signature)
Reads all fingerprints from the signature file , returns a list of all found fingerprints.
std::list< PublicKeyData > readKeyFromFile(const Pathname &file)
Returns a list of all PublicKeyData found in file.
RW_pointer< Impl > _pimpl
Pointer to implementation.
Definition KeyManager.h:90
bool deleteKey(const std::string &id)
Tries to delete a key specified by id, returns true on success.
Pathname homedir() const
Return the homedir/keyring.
bool importKey(const Pathname &keyfile)
Tries to import a key from keyfile, returns true on success.
Easy-to use interface to the ZYPP dependency resolver.