Related tdf#118581 Use subject name, not issuer name for signature line

And map the gpg user also the the subject name

Change-Id: I1db7b93b6bfc82304924d6ef90db18ff4f97e13c
Reviewed-on: https://gerrit.libreoffice.org/63278
Tested-by: Jenkins
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
diff --git a/cui/source/dialogs/SignSignatureLineDialog.cxx b/cui/source/dialogs/SignSignatureLineDialog.cxx
index a3230ee..d35c5db 100644
--- a/cui/source/dialogs/SignSignatureLineDialog.cxx
+++ b/cui/source/dialogs/SignSignatureLineDialog.cxx
@@ -141,7 +141,7 @@ IMPL_LINK_NOARG(SignSignatureLineDialog, chooseCertificate, weld::Button&, void)
    {
        m_xSelectedCertifate = xSignCertificate;
        m_xBtnChooseCertificate->set_label(
            xmlsec::GetContentPart(xSignCertificate->getIssuerName()));
            xmlsec::GetContentPart(xSignCertificate->getSubjectName()));
    }
    ValidateFields();
}
@@ -180,7 +180,7 @@ SignSignatureLineDialog::getSignedGraphic(bool bValid)
    aSvgImage = aSvgImage.replaceAll("[SIGNATURE]", getCDataString(m_xEditName->get_text()));
    OUString aIssuerLine
        = CuiResId(RID_SVXSTR_SIGNATURELINE_SIGNED_BY)
              .replaceFirst("%1", xmlsec::GetContentPart(m_xSelectedCertifate->getIssuerName()));
              .replaceFirst("%1", xmlsec::GetContentPart(m_xSelectedCertifate->getSubjectName()));
    aSvgImage = aSvgImage.replaceAll("[SIGNED_BY]", getCDataString(aIssuerLine));
    if (bValid)
        aSvgImage = aSvgImage.replaceAll("[INVALID_SIGNATURE]", "");
diff --git a/xmlsecurity/source/gpg/CertificateImpl.cxx b/xmlsecurity/source/gpg/CertificateImpl.cxx
index 4a2934a..72fed74 100644
--- a/xmlsecurity/source/gpg/CertificateImpl.cxx
+++ b/xmlsecurity/source/gpg/CertificateImpl.cxx
@@ -61,8 +61,8 @@ OUString SAL_CALL CertificateImpl::getIssuerName()

OUString SAL_CALL CertificateImpl::getSubjectName()
{
    // Empty for gpg
    return OUString();
    // Samue as issuer name (user ID)
    return getIssuerName();
}

namespace {