391 lines
5.3 KiB
Plaintext
391 lines
5.3 KiB
Plaintext
/*
|
|
* Copyright 2019 Haiku, Inc. All rights reserved.
|
|
* Distributed under the terms of the MIT License.
|
|
*
|
|
* Authors:
|
|
* Niels Sascha Reedijk, niels.reedijk@gmail.com
|
|
*
|
|
* Corresponds to:
|
|
* headers/os/app/KeyStore.h hrev45434
|
|
* src/kits/app/KeyStore.cpp hrev45434
|
|
*/
|
|
|
|
|
|
/*!
|
|
\file KeyStore.h
|
|
\ingroup app
|
|
\ingroup libbe
|
|
\brief Provides BKeyStore class.
|
|
*/
|
|
|
|
|
|
/*!
|
|
\class BKeyStore
|
|
\ingroup app
|
|
\ingroup libbe
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn BKeyStore::BKeyStore()
|
|
\brief undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn virtual BKeyStore::~BKeyStore()
|
|
\brief undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
/*!
|
|
\name Key Management
|
|
*/
|
|
|
|
|
|
//! @{
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::GetKey(BKeyType type, const char* identifier,
|
|
BKey& key)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::GetKey(BKeyType type, const char* identifier,
|
|
const char* secondaryIdentifier, BKey& key)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::GetKey(BKeyType type, const char* identifier,
|
|
const char* secondaryIdentifier, bool secondaryIdentifierOptional,
|
|
BKey& key)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::GetKey(const char* keyring, BKeyType type,
|
|
const char* identifier, BKey& key)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::GetKey(const char* keyring, BKeyType type,
|
|
const char* identifier, const char* secondaryIdentifier, BKey& key)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::GetKey(const char* keyring, BKeyType type,
|
|
const char* identifier, const char* secondaryIdentifier,
|
|
bool secondaryIdentifierOptional, BKey& key)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::AddKey(const BKey& key)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::AddKey(const char* keyring, const BKey& key)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::RemoveKey(const BKey& key)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::RemoveKey(const char* keyring, const BKey& key)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::GetNextKey(uint32& cookie, BKey& key);
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::GetNextKey(BKeyType type, BKeyPurpose purpose,
|
|
uint32& cookie, BKey& key)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::GetNextKey(const char* keyring, uint32& cookie,
|
|
BKey& key)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::GetNextKey(const char* keyring, BKeyType type,
|
|
BKeyPurpose purpose, uint32& cookie, BKey& key)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
//! @}
|
|
|
|
|
|
/*!
|
|
\name Keyrings
|
|
*/
|
|
|
|
|
|
//! @{
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::AddKeyring(const char* keyring)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::RemoveKeyring(const char* keyring)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::GetNextKeyring(uint32& cookie, BString& keyring)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::SetUnlockKey(const char* keyring, const BKey& key)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::RemoveUnlockKey(const char* keyring)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
//! @}
|
|
|
|
|
|
/*!
|
|
\name Master keyring
|
|
*/
|
|
|
|
|
|
//! @{
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::SetMasterUnlockKey(const BKey& key)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::RemoveMasterUnlockKey()
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::AddKeyringToMaster(const char* keyring)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::RemoveKeyringFromMaster(const char* keyring)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::GetNextMasterKeyring(uint32& cookie,
|
|
BString& keyring)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
//! @}
|
|
|
|
|
|
/*!
|
|
\name Locking
|
|
*/
|
|
|
|
|
|
//! @{
|
|
|
|
|
|
/*!
|
|
\fn bool BKeyStore::IsKeyringUnlocked(const char* keyring)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::LockKeyring(const char* keyring)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::LockMasterKeyring()
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
//! @}
|
|
|
|
|
|
/*!
|
|
\name Applications
|
|
*/
|
|
|
|
|
|
//! @{
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::GetNextApplication(uint32& cookie,
|
|
BString& signature) const
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::GetNextApplication(const char* keyring,
|
|
uint32& cookie, BString& signature) const
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::RemoveApplication(const char* signature)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::RemoveApplication(const char* keyring,
|
|
const char* signature)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
//! @}
|
|
|
|
|
|
/*!
|
|
\name Service Functions
|
|
*/
|
|
|
|
|
|
//! @{
|
|
|
|
|
|
/*!
|
|
\fn status_t BKeyStore::GeneratePassword(BPasswordKey& password,
|
|
size_t length, uint32 flags)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
/*!
|
|
\fn float BKeyStore::PasswordStrength(const char* password)
|
|
\brief Undocumented
|
|
|
|
\since Haiku R1
|
|
*/
|
|
|
|
|
|
//! @}
|