libzypp
11.13.5
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
libzypp
Welcome to libzypp
Code Pitfalls - Frequently made mistakes
Code Snippets
Environment Variables
Testing for provided features.
Notes on revisions
Extending ZYpp: Plugins and Hooks
Services
Solver - Vendor protection
Writing and tunning testcases
Libzypp and threads
Todo List
Deprecated List
Modules
Namespaces
Classes
Files
File List
zypp
base
media
misc
parser
pool
repo
sat
solver
target
thread
ui
url
ws
zypp_detail
APIConfig.h
Arch.cc
Arch.h
AutoDispose.h
Bit.h
ByteCount.cc
ByteCount.h
Callback.h
Capabilities.cc
Capabilities.h
Capability.cc
Capability.h
CapMatch.cc
CapMatch.h
Changelog.cc
Changelog.h
CheckSum.cc
CheckSum.h
CountryCode.cc
CountryCode.h
Date.cc
Date.h
Dep.cc
Dep.h
Digest.cc
Digest.h
DiskUsage.cc
DiskUsage.h
DiskUsageCounter.cc
DiskUsageCounter.h
DownloadMode.cc
DownloadMode.h
Edition.cc
Edition.h
ExternalProgram.cc
ExternalProgram.h
Fetcher.cc
Fetcher.h
FileChecker.cc
FileChecker.h
Filter.h
Glob.cc
Glob.h
HistoryLog.cc
HistoryLog.h
HistoryLogData.cc
HistoryLogData.h
IdString.cc
IdString.h
IdStringType.h
InstanceId.cc
InstanceId.h
KeyContext.h
KeyRing.cc
KeyRing.h
KVMap.h
LanguageCode.cc
LanguageCode.h
Locale.cc
Locale.h
Locks.cc
Locks.h
ManagedFile.h
MediaProducts.cc
MediaProducts.h
MediaSetAccess.cc
MediaSetAccess.h
Misc.h
OnMediaLocation.cc
OnMediaLocation.h
Package.cc
Package.h
PackageKeyword.h
Patch.cc
Patch.h
PathInfo.cc
PathInfo.h
Pathname.cc
Pathname.h
Pattern.cc
Pattern.h
PluginFrame.cc
PluginFrame.h
PluginFrameException.cc
PluginFrameException.h
PluginScript.cc
PluginScript.h
PluginScriptException.cc
PluginScriptException.h
PoolItem.cc
PoolItem.h
PoolItemBest.cc
PoolItemBest.h
PoolQuery.cc
PoolQuery.h
PoolQueryResult.cc
PoolQueryResult.h
PoolQueryUtil.tcc
ProblemSolution.cc
ProblemSolution.h
ProblemTypes.h
Product.cc
Product.h
ProgressData.cc
ProgressData.h
ProvideFilePolicy.cc
ProvideFilePolicy.h
PublicKey.cc
PublicKey.h
Range.cc
Range.h
Rel.cc
Rel.h
RelCompare.h
RepoInfo.cc
RepoInfo.h
RepoManager.cc
RepoManager.h
Repository.cc
Repository.h
RepoStatus.cc
RepoStatus.h
ResFilters.h
ResKind.cc
ResKind.h
ResObject.cc
ResObject.h
ResObjects.h
Resolvable.cc
Resolvable.h
Resolver.cc
Resolver.h
ResolverProblem.cc
ResolverProblem.h
ResPool.cc
ResPool.h
ResPoolProxy.cc
ResPoolProxy.h
ResStatus.cc
ResStatus.h
ResTraits.h
ServiceInfo.cc
ServiceInfo.h
Signature.cc
Signature.h
SrcPackage.cc
SrcPackage.h
SysContent.cc
SysContent.h
Target.cc
Target.h
TmpPath.cc
TmpPath.h
TriBool.h
Url.cc
Url.h
Vendor.h
VendorAttr.cc
VendorAttr.h
VendorSupportOptions.cc
VendorSupportOptions.h
ZConfig.cc
ZConfig.h
ZYpp.cc
ZYpp.h
ZYppCallbacks.h
ZYppCommit.h
ZYppCommitPolicy.cc
ZYppCommitPolicy.h
ZYppCommitResult.cc
ZYppCommitResult.h
ZYppFactory.cc
ZYppFactory.h
File Members
PublicKey.h
Go to the documentation of this file.
1
/*---------------------------------------------------------------------\
2
| ____ _ __ __ ___ |
3
| |__ / \ / / . \ . \ |
4
| / / \ V /| _/ _/ |
5
| / /__ | | | | | | |
6
| /_____||_| |_| |_| |
7
| |
8
\---------------------------------------------------------------------*/
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/base/Exception.h
"
23
#include "
zypp/Pathname.h
"
24
#include "
zypp/Date.h
"
25
27
namespace
zypp
28
{
29
30
namespace
filesystem
31
{
32
class
TmpFile;
33
}
34
39
class
BadKeyException
:
public
Exception
40
{
41
public
:
45
BadKeyException
()
46
:
Exception
(
"Bad Key Exception"
)
47
{}
48
49
Pathname
keyFile
()
const
50
{
return
_keyfile
; }
51
55
BadKeyException
(
const
std::string & msg_r,
const
Pathname &keyfile = Pathname() )
56
:
Exception
( msg_r ),
_keyfile
(keyfile)
57
{}
59
virtual
~BadKeyException
() throw() {};
60
private
:
61
Pathname
_keyfile
;
62
};
64
74
class
PublicKeyData
75
{
76
public
:
78
PublicKeyData
();
79
80
~PublicKeyData
();
81
83
friend
class
PublicKeyScanner
;
84
86
explicit
operator
bool()
const
;
87
88
public
:
90
std::string
id
()
const
;
91
93
std::string
name
()
const
;
94
96
std::string
fingerprint
()
const
;
97
99
Date
created
()
const
;
100
102
Date
expires
()
const
;
103
105
bool
expired
()
const
;
106
112
int
daysToLive
()
const
;
113
126
std::string
expiresAsString
()
const
;
127
129
std::string
gpgPubkeyVersion
()
const
;
130
132
std::string
gpgPubkeyRelease
()
const
;
133
140
std::string
asString
()
const
;
141
142
private
:
143
class
Impl
;
144
RWCOW_pointer<Impl>
_pimpl
;
145
};
147
149
inline
std::ostream &
operator<<
( std::ostream & str,
const
PublicKeyData
& obj )
150
{
return
str << obj.
asString
(); }
151
153
std::ostream &
dumpOn
( std::ostream & str,
const
PublicKeyData
& obj );
154
156
bool
operator==
(
const
PublicKeyData
& lhs,
const
PublicKeyData
& rhs );
157
159
inline
bool
operator!=
(
const
PublicKeyData
& lhs,
const
PublicKeyData
& rhs )
160
{
return
!( lhs == rhs ); }
161
179
struct
PublicKeyScanner
180
{
181
PublicKeyScanner
();
182
~PublicKeyScanner
();
183
185
void
scan
( std::string line_r );
186
188
std::list<PublicKeyData>
_keys
;
189
190
private
:
191
class
Impl
;
192
RW_pointer<Impl, rw_pointer::Scoped<Impl>
>
_pimpl
;
193
};
195
196
208
class
PublicKey
209
{
210
public
:
212
class
Impl
;
213
214
public
:
216
PublicKey
();
217
226
explicit
PublicKey
(
const
Pathname & keyFile_r );
227
234
explicit
PublicKey
(
const
filesystem::TmpFile
& sharedFile_r );
235
236
~PublicKey
();
237
238
public
:
240
const
PublicKeyData
&
keyData
()
const
;
241
242
bool
isValid
()
const
243
{
return
! (
id
().empty() ||
fingerprint
().empty() ); }
244
245
std::string
id
()
const
;
246
std::string
name
()
const
;
247
std::string
fingerprint
()
const
;
248
Date
created
()
const
;
249
Date
expires
()
const
;
250
std::string
expiresAsString
()
const
;
251
bool
expired
()
const
;
252
int
daysToLive
()
const
;
253
std::string
gpgPubkeyVersion
()
const
;
254
std::string
gpgPubkeyRelease
()
const
;
255
std::string
asString
()
const
;
256
257
public
:
259
Pathname
path
()
const
;
260
262
const
std::list<PublicKeyData> &
hiddenKeys
()
const
;
263
264
public
:
265
bool
operator==
(
PublicKey
rhs )
const
;
// FIXME: change arg to const&
266
bool
operator==
( std::string sid )
const
;
// FIXME: change arg to const&
267
268
private
:
269
friend
class
KeyRing
;
271
PublicKey
(
const
filesystem::TmpFile
& sharedFile_r,
const
PublicKeyData
& keyData_r );
272
273
private
:
275
RWCOW_pointer<Impl>
_pimpl
;
276
};
278
280
inline
std::ostream &
operator<<
( std::ostream & str,
const
PublicKey
& obj )
281
{
return
str << obj.
asString
(); }
282
284
std::ostream &
dumpOn
( std::ostream & str,
const
PublicKey
& obj );
285
287
}
// namespace zypp
289
#endif // ZYPP_PUBLICKEY_H
zypp
PublicKey.h
Generated by
1.8.1