- Source::provideResolvables not implemented in yum source type.
[platform/upstream/libzypp.git] / zypp / PublicKey.h
1 /*---------------------------------------------------------------------\
2 |                          ____ _   __ __ ___                          |
3 |                         |__  / \ / / . \ . \                         |
4 |                           / / \ V /|  _/  _/                         |
5 |                          / /__ | | | | | |                           |
6 |                         /_____||_| |_| |_|                           |
7 |                                                                      |
8 \---------------------------------------------------------------------*/
9 /** \file       zypp/PublicKey.h
10  *
11 */
12 #ifndef ZYPP_PUBLICKEY_H
13 #define ZYPP_PUBLICKEY_H
14
15 #include <iosfwd>
16 #include <map>
17 #include <list>
18 #include <set>
19 #include <string>
20
21 #include "zypp/base/PtrTypes.h"
22 #include "zypp/Pathname.h"
23
24 ///////////////////////////////////////////////////////////////////
25 namespace zypp
26 { /////////////////////////////////////////////////////////////////
27 namespace devel
28 {
29   ///////////////////////////////////////////////////////////////////
30   //
31   //    CLASS NAME : PublicKey
32   //
33   /** Class that represent a GPG Public Key
34   */
35   class PublicKey
36   {
37     friend std::ostream & operator<<( std::ostream & str, const PublicKey & obj );
38
39   public:
40     /** Implementation  */
41     class Impl;
42
43   public:
44     PublicKey();
45    /** Ctor 
46     * \throws when data does not make a key
47     */
48     PublicKey(const std::istream &data);
49     PublicKey(const Pathname &file);
50     ~PublicKey();
51     
52     std::string asString() const;
53     std::string armoredData() const;
54     std::string id() const;
55     std::string name() const;
56     std::string fingerprint() const;
57     
58   private:
59     /** Pointer to implementation */
60     RWCOW_pointer<Impl> _pimpl;
61   };
62   ///////////////////////////////////////////////////////////////////
63
64   /** \relates PublicKey Stream output */
65   inline std::ostream & operator<<( std::ostream & str, const PublicKey & obj )
66   { return str << obj.asString(); }
67
68   /////////////////////////////////////////////////////////////////
69 } // namespace zypp
70 }
71 ///////////////////////////////////////////////////////////////////
72 #endif // ZYPP_PUBLICKEY_H