libzypp: zypp-common/KeyManager.h Source File

libzypp 17.38.7

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-core/base/PtrTypes.h>
16#include <zypp-core/Pathname.h>
17#include <zypp-common/PublicKey.h>
18#include <zypp-core/ByteArray.h>
19
20namespace zypp
21{
22
30 class KeyManagerCtx
31{
32 public:
43 static KeyManagerCtx createForOpenPGP();
44
52 static KeyManagerCtx createForOpenPGP( const Pathname & keyring_r );
53
55 Pathname homedir() const;
56
58 std::list<PublicKeyData> listKeys();
59
61 std::list<PublicKeyData> readKeyFromFile(const Pathname & file);
62
64 bool verify(const Pathname & file, const Pathname & signature);
65
67 bool exportKey(const std::string & id, std::ostream & stream);
68
70 bool importKey(const Pathname & keyfile);
71
73 bool importKey(const ByteArray & keydata);
74
76 bool deleteKey (const std::string & id);
77
79 std::list<std::string> readSignatureFingerprints(const Pathname & signature);
80
82 std::list<std::string> readSignatureFingerprints( const ByteArray & keyData );
83
84 private:
85 KeyManagerCtx();
86
87 class Impl;
88 RW_pointer<Impl> _pimpl;
89};
90
91}
92
93
94#endif
ByteArray.h
Pathname.h
PtrTypes.h
PublicKey.h
zypp::ByteArray
Definition ByteArray.h:19
zypp::KeyManagerCtx::Impl
Definition KeyManager.cc:149
zypp::KeyManagerCtx::KeyManagerCtx
KeyManagerCtx()
Definition KeyManager.cc:316
zypp::KeyManagerCtx::exportKey
bool exportKey(const std::string &id, std::ostream &stream)
Exports the key with id into the given stream, returns true on success.
Definition KeyManager.cc:433
zypp::KeyManagerCtx::listKeys
std::list< PublicKeyData > listKeys()
Returns a list of all public keys found in the current keyring.
Definition KeyManager.cc:375
zypp::KeyManagerCtx::verify
bool verify(const Pathname &file, const Pathname &signature)
Tries to verify file using signature, returns true on success.
Definition KeyManager.cc:428
zypp::KeyManagerCtx::createForOpenPGP
static KeyManagerCtx createForOpenPGP()
Creates a new KeyManagerCtx for PGP using a volatile temp.
Definition KeyManager.cc:320
zypp::KeyManagerCtx::readSignatureFingerprints
std::list< std::string > readSignatureFingerprints(const Pathname &signature)
Reads all fingerprints from the signature file , returns a list of all found fingerprints.
Definition KeyManager.cc:588
zypp::KeyManagerCtx::readKeyFromFile
std::list< PublicKeyData > readKeyFromFile(const Pathname &file)
Returns a list of all PublicKeyData found in file.
Definition KeyManager.cc:405
zypp::KeyManagerCtx::_pimpl
RW_pointer< Impl > _pimpl
Pointer to implementation.
Definition KeyManager.h:88
zypp::KeyManagerCtx::deleteKey
bool deleteKey(const std::string &id)
Tries to delete a key specified by id, returns true on success.
Definition KeyManager.cc:560
zypp::KeyManagerCtx::homedir
Pathname homedir() const
Return the homedir/keyring.
Definition KeyManager.cc:367
zypp::KeyManagerCtx::importKey
bool importKey(const Pathname &keyfile)
Tries to import a key from keyfile, returns true on success.
Definition KeyManager.cc:502
zypp::filesystem::Pathname
Pathname.
Definition Pathname.h:48
zypp
Easy-to use interface to the ZYPP dependency resolver.
Definition CodePitfalls.doc:2
zypp::RW_pointer
Wrapper for const correct access via Smart pointer types.
Definition PtrTypes.h:293