Fix FreeBSD build.
[haiku.git] / headers / os / app / KeyStore.h
blob7c5a86d6383e38309e6ad2332537560bc051f170
1 /*
2 * Copyright 2011, Haiku, Inc.
3 * Distributed under the terms of the MIT License.
4 */
5 #ifndef _KEY_STORE_H
6 #define _KEY_STORE_H
9 #include <Key.h>
12 class BKeyStore {
13 public:
14 BKeyStore();
15 virtual ~BKeyStore();
17 status_t GetKey(BKeyType type, const char* identifier,
18 BKey& key);
19 status_t GetKey(BKeyType type, const char* identifier,
20 const char* secondaryIdentifier, BKey& key);
21 status_t GetKey(BKeyType type, const char* identifier,
22 const char* secondaryIdentifier,
23 bool secondaryIdentifierOptional,
24 BKey& key);
26 status_t GetKey(const char* keyring,
27 BKeyType type, const char* identifier,
28 BKey& key);
29 status_t GetKey(const char* keyring,
30 BKeyType type, const char* identifier,
31 const char* secondaryIdentifier, BKey& key);
32 status_t GetKey(const char* keyring,
33 BKeyType type, const char* identifier,
34 const char* secondaryIdentifier,
35 bool secondaryIdentifierOptional,
36 BKey& key);
38 status_t AddKey(const BKey& key);
39 status_t AddKey(const char* keyring, const BKey& key);
40 status_t RemoveKey(const BKey& key);
41 status_t RemoveKey(const char* keyring, const BKey& key);
43 status_t GetNextKey(uint32& cookie, BKey& key);
44 status_t GetNextKey(BKeyType type, BKeyPurpose purpose,
45 uint32& cookie, BKey& key);
46 status_t GetNextKey(const char* keyring,
47 uint32& cookie, BKey& key);
48 status_t GetNextKey(const char* keyring,
49 BKeyType type, BKeyPurpose purpose,
50 uint32& cookie, BKey& key);
52 // Keyrings
54 status_t AddKeyring(const char* keyring);
55 status_t RemoveKeyring(const char* keyring);
57 status_t GetNextKeyring(uint32& cookie,
58 BString& keyring);
60 status_t SetUnlockKey(const char* keyring,
61 const BKey& key);
62 status_t RemoveUnlockKey(const char* keyring);
64 // Master keyring
66 status_t SetMasterUnlockKey(const BKey& key);
67 status_t RemoveMasterUnlockKey();
69 status_t AddKeyringToMaster(const char* keyring);
70 status_t RemoveKeyringFromMaster(const char* keyring);
72 status_t GetNextMasterKeyring(uint32& cookie,
73 BString& keyring);
75 // Locking
77 bool IsKeyringUnlocked(const char* keyring);
78 status_t LockKeyring(const char* keyring);
79 status_t LockMasterKeyring();
81 // Applications
83 status_t GetNextApplication(uint32& cookie,
84 BString& signature) const;
85 status_t GetNextApplication(const char* keyring,
86 uint32& cookie, BString& signature) const;
87 status_t RemoveApplication(const char* signature);
88 status_t RemoveApplication(const char* keyring,
89 const char* signature);
91 // Service functions
93 status_t GeneratePassword(BPasswordKey& password,
94 size_t length, uint32 flags);
95 float PasswordStrength(const char* password);
97 private:
98 status_t _SendKeyMessage(BMessage& message,
99 BMessage* reply) const;
103 #endif // _KEY_STORE_H