output = Crypto::Data(input.type, output_key->getDER());
} else if (input.type.isCertificate() || input.type.isChainCert()) {
- CertificateShPtr cert = CKM::Certificate::create(input.data,
- DataFormat::FORM_DER);
+ CertificateShPtr cert = CKM::Certificate::create(input.data, DataFormat::FORM_DER);
if (cert.get() == NULL) {
LogDebug("provided binary data is not valid certificate data");
return tryRet([&] {
// Key is for internal service use. It won't be exported to the client
Crypto::GObjUPtr obj;
- int retCode = readDataHelper(false, cred, DataType::DB_KEY_FIRST, name, owner,
- pass, obj);
-
+ int retCode = readDataHelper(false, cred, DataType::DB_KEY_FIRST, name, owner, pass, obj);
if (retCode == CKM_API_SUCCESS)
key = std::move(obj);
store.destroy(row);
// import it to store with new scheme: data -> pass(data)
- Token token = store.import(Crypto::Data(row.dataType, row.data), pass, Crypto::EncryptionParams(), hash);
+ Token token = store.import(Crypto::Data(row.dataType, row.data),
+ pass,
+ Crypto::EncryptionParams(),
+ hash);
// get it from the store (it can be different than the data we imported into store)
obj = store.getObject(token, pass);
int retCode = tryRet([&] {
Crypto::GObjUPtr obj;
int retCode = readDataHelper(true, cred, dataType, name, owner,
- password, obj, objDataType);
+ password, obj, objDataType);
if (retCode == CKM_API_SUCCESS)
rowData = obj->getBinary();
// system database
if (m_accessControl.isSystemService(cred)) {
// lookup system DB
- retCode = getDataListHelper(Credentials(SYSTEM_DB_UID,
- CLIENT_ID_SYSTEM),
+ retCode = getDataListHelper(Credentials(SYSTEM_DB_UID, CLIENT_ID_SYSTEM),
dataType,
systemVector);
} else {
// user - lookup system, then client DB
- retCode = getDataListHelper(Credentials(SYSTEM_DB_UID,
- cred.client),
+ retCode = getDataListHelper(Credentials(SYSTEM_DB_UID, cred.client),
dataType,
systemVector);
if (retCode != CKM_API_SUCCESS)
return retCode;
- Crypto::GStore &store = m_decider.getStore(data.type,
- policy,
- !encParams.iv.empty());
+ Crypto::GStore &store = m_decider.getStore(data.type, policy, !encParams.iv.empty());
Token token;
retCode = tryRet([&] {
Crypto::GObjUPtr obj;
int retCode = readDataHelper(false, cred, DataType::DB_KEY_FIRST, privateKeyName,
- owner, password, obj);
+ owner, password, obj);
if (retCode == CKM_API_SUCCESS)
signature = obj->sign(cryptoAlg, message);
// rather than private key from the same PKCS.
Crypto::GObjUPtr obj;
int retCode = readDataHelper(false, cred, DataType::CERTIFICATE,
- publicKeyOrCertName, owner, password, obj);
+ publicKeyOrCertName, owner, password, obj);
if (retCode == CKM_API_ERROR_DB_ALIAS_UNKNOWN)
retCode = readDataHelper(false, cred, DataType::DB_KEY_FIRST,