#include <access-control.h>
#include <certificate-impl.h>
#include <sys/types.h>
+#include <generic-backend/gkey.h>
#include <platform/decider.h>
class CKMLogic {
public:
static const uid_t SYSTEM_DB_UID;
- class Exception
- {
- public:
- DECLARE_EXCEPTION_TYPE(CKM::Exception, Base)
- DECLARE_EXCEPTION_TYPE(Base, DatabaseLocked)
- };
CKMLogic();
CKMLogic(const CKMLogic &) = delete;
RawBuffer createKeyPair(
const Credentials &cred,
- LogicCommand protocol_cmd,
int commandId,
- const int additional_param,
+ const CryptoAlgorithmSerializable & keyGenParams,
const Name &namePrivate,
const Label &labelPrivate,
const Name &namePublic,
const PolicySerializable &policyPrivate,
const PolicySerializable &policyPublic);
+ RawBuffer createKeyAES(
+ const Credentials &cred,
+ int commandId,
+ const int size,
+ const Name &name,
+ const Label &label,
+ const PolicySerializable &policy);
+
RawBuffer getCertificateChain(
const Credentials &cred,
int commandId,
DataType dataType,
const PolicySerializable &policy);
+ int getKeyForService(const Credentials &cred,
+ const Name &name,
+ const Label &label,
+ const Password& pass,
+ Crypto::GKeyShPtr& key);
+
private:
// select private/system database depending on asking uid and owner label.
const Password &password,
DB::RowVector &rows);
+ int createKeyAESHelper(
+ const Credentials &cred,
+ const int size,
+ const Name &name,
+ const Label &label,
+ const PolicySerializable &policy);
+
int createKeyPairHelper(
const Credentials &cred,
- const KeyType key_type,
- const int additional_param,
+ const CryptoAlgorithmSerializable & keyGenParams,
const Name &namePrivate,
const Label &labelPrivate,
const Name &namePublic,