const CertificateShPtr& certificate,
const AliasVector& untrustedCertificates)
{
+ LabelNameVector untrusted_certs;
+ for (auto &e: untrustedCertificates) {
+ AliasSupport helper(e);
+ untrusted_certs.push_back(std::make_pair(helper.getLabel(), helper.getName()));
+ }
+
m_impl->getCertChain(observer,
LogicCommand::GET_CHAIN_ALIAS,
certificate,
- untrustedCertificates);
+ untrusted_certs);
}
void ManagerAsync::createSignature(const ObserverPtr& observer,
const AliasVector &untrustedCertificates,
CertificateShPtrVector &certificateChainVector)
{
+ LabelNameVector untrusted_certs;
+ for (auto &e: untrustedCertificates) {
+ AliasSupport helper(e);
+ untrusted_certs.push_back(std::make_pair(helper.getLabel(), helper.getName()));
+ }
+
return getCertChain(
LogicCommand::GET_CHAIN_ALIAS,
++m_counter,
certificate,
- untrustedCertificates,
+ untrusted_certs,
certificateChainVector,
m_storageConnection);
}
Credentials &cred,
int commandId,
const RawBuffer &certificate,
- const AliasVector &aliasVector)
+ const LabelNameVector &labelNameVector)
{
int retCode = CKM_API_SUCCESS;
- std::size_t separator_pos = 0;
RawBufferVector chainRawVector;
try {
CertificateImpl cert(certificate, DataFormat::FORM_DER);
goto senderror;
}
- for (auto &i: aliasVector) {
- if ((separator_pos = i.rfind(LABEL_NAME_SEPARATOR)) == Alias::npos) {
- // No label prefixed in alias. put empty label
- retCode = getDataHelper(
- cred,
- DBDataType::CERTIFICATE,
- i,
- Label(),
- Password(),
- row);
- }
- else {
- retCode = getDataHelper(
- cred,
- DBDataType::CERTIFICATE,
- i.substr(separator_pos+strlen(LABEL_NAME_SEPARATOR)), // alias
- Label(i.substr(0, separator_pos)), // label
- Password(),
- row);
- }
+ for (auto &i: labelNameVector) {
+ retCode = getDataHelper(cred, DBDataType::CERTIFICATE, i.second, i.first, Password(), row);
if (retCode != CKM_API_SUCCESS)
goto senderror;
Credentials &cred,
int commandId,
const RawBuffer &certificate,
- const AliasVector &aliasVector);
+ const LabelNameVector &labelNameVector);
RawBuffer createSignature(
Credentials &cred,
case LogicCommand::GET_CHAIN_ALIAS:
{
RawBuffer certificate;
- AliasVector aliasVector;
- buffer.Deserialize(certificate, aliasVector);
+ LabelNameVector untrusted_certs;
+ buffer.Deserialize(certificate, untrusted_certs);
return m_logic->getCertificateChain(
cred,
msgID,
certificate,
- aliasVector);
+ untrusted_certs);
}
case LogicCommand::CREATE_SIGNATURE:
{