libzypp  17.7.2
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 
19 #include <memory>
20 
21 namespace zypp
22 {
23 
32 {
33  public:
34  typedef shared_ptr<KeyManagerCtx> Ptr;
35 
37  static Ptr createForOpenPGP();
38 
40  bool setHomedir (const Pathname & keyring_r);
41  Pathname homedir ()const;
42 
44  std::list<PublicKeyData> listKeys();
45 
47  std::list<PublicKeyData> readKeyFromFile(const Pathname & file);
48 
50  bool verify(const Pathname & file, const Pathname & signature);
51 
53  bool exportKey(const std::string & id, std::ostream & stream);
54 
56  bool importKey(const Pathname & keyfile);
57 
59  bool deleteKey (const std::string & id);
60 
62  std::list<std::string> readSignatureFingerprints(const Pathname & signature);
63 
64  private:
65  class Impl;
66 
67  KeyManagerCtx();
68 
70 
71 };
72 
73 }
74 
75 
76 #endif
static Ptr createForOpenPGP()
Creates a new KeyManagerCtx for PGP.
Definition: KeyManager.cc:193
std::list< PublicKeyData > readKeyFromFile(const Pathname &file)
Returns a list of all.
Definition: KeyManager.cc:270
bool verify(const Pathname &file, const Pathname &signature)
Tries to verify file using signature, returns true on success.
Definition: KeyManager.cc:291
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:299
RW_pointer< Impl > _pimpl
Pointer to implementation.
Definition: KeyManager.h:69
Pathname homedir() const
Definition: KeyManager.cc:240
bool importKey(const Pathname &keyfile)
Tries to import a key from keyfile, returns true on success.
Definition: KeyManager.cc:364
bool deleteKey(const std::string &id)
Tries to delete a key specified by id, returns true on success.
Definition: KeyManager.cc:387
std::list< PublicKeyData > listKeys()
Returns a list of all public keys found in the current keyring.
Definition: KeyManager.cc:249
bool setHomedir(const Pathname &keyring_r)
Changes the keyring directory.
Definition: KeyManager.cc:218
shared_ptr< KeyManagerCtx > Ptr
Definition: KeyManager.h:34
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:415
Easy-to use interface to the ZYPP dependency resolver.
Definition: CodePitfalls.doc:1