Signing PDF and XML files in conzept 16

In this article, we would like to report on digital signatures and the new features in this regard in conzept 16.

Digital signatures

In the upcoming version 5.9.06 of concept 16, it will be possible to sign PDF and XML files. Die Signierung ermöglicht es Empfängern, die Herkunft von PDFs und XMLs zu verifizieren. Besonders bei E-Rechnungen im ZUGFeRD-Format ist dies von Bedeutung, da diese, wie wir bereits in unserem Blog berichtet haben, ab 2025 verpflichtend sind. Die elektronische Signatur selbst ist bei ZUGFeRD in Deutschland nicht verpflichtend, sorgt aber für Sicherheit auf beiden Seiten.
Für die Signierung benötigen Sie eine .pfx oder .p12 Datei, die ein X.509 Zertifikat enthält. Dies ist auch derselbe Typ von Zertifikat, der für die Verschlüsselung von HTTPS verwendet wird. Hier können Sie auch ein existierendes Zertifikat, welches für die Verschlüsselung Ihrer Website genutzt wird, wiederverwenden. So ein gültiges Zertifikat erhält man zum Beispiel bei Let’s Encrypt.

Signieren von PDF-Dateien

Um eine PDF-Datei zu signieren, werden beim Schließen des in conzept 16 bearbeiteten PDFs mit PdfClose die Zertifikatsdatei und das Passwort von dem Zertifikat angegeben. Der “PdfClose(..)” Befehl existiert auch in den früheren Versionen von conzept 16, wird aber in der kommenden Version, um die Signierung zu ermöglichen, erweitert.

sub SignPdf(aPdfFile : alpha(8192); aCertFile : alpha(8192); aCertPassword : alpha; var aOutFileName : alpha; var aOutLogName : alpha) : int
local
{
  tPdf : handle;
}
{
  // Pfade setzten, PDF öffnen
  aOutFileName # _Sys->spPathTemp + 'signed_pdf.pdf';
  aOutLogName # _Sys->spPathTemp + 'signed_pdf.txt';
  tPdf # PdfOpen(aPdfFile,_PdfOpenDefault,'',_PdfImportAll);
  
  // aCertFile - Zertifikatdatei .pfx oder .p12
  // aCertPassword - Passwort für die jeweilige Zertifikatdatei
  return(tPdf->PdfClose(aOutFileName,_PdfModePdfNormal,aOutLogName,aCertFile,aCertPassword));
}

Signieren von XML-Dateien

Für das Signieren von XML-Dateien wurde der neue Befehl “XmlSign(..)” hinzugefügt. Das Signieren mit XmlSign funktioniert ähnlich wie PdfClose:

sub SignXml(aXmlFile : alpha(8192); aCertFile : alpha(8192); aCertPassword : alpha; var aOutFileName : alpha) : int
{
  // Pfad setzen
  aOutFileName # _Sys->spPathTemp + 'signed_xml.xml';
  
  // aXmlFile - Eingabe XML-Datei
  // aOutFileName - Ausgabe von signierter XML-Datei
  // aCertFile - Zertifikatdatei .pfx oder .p12
  // aCertPassword - Passwort für die jeweilige Zertifikatdatei
  return(XmlSign(aXmlFile,aOutFileName,aCertFile,aCertPassword));
}

Die Signatur in den XML-Dateien ist eine sogenannte “enveloped signature”, was bedeutet, dass die existierende XML-Datei in die Signatur eingebettet wird und danach von <Signature> XML Tags eingeschlossen ist.

Digitale Signaturen verifizieren

Um Signaturen zu verifizieren, braucht der Empfänger jeweils eine entsprechende Software zu deren Verarbeitung. Bei PDFs können digitale Signaturen ganz einfach mit der gängigen Adobe Acrobat Software verifiziert werden. Für XMLs gibt es Online-Tools wie bspw. Chilkat, aber auch die Möglichkeit, für die Verifizierung eine eigene Lösung on-premise zu bauen.

Mit der Signierung von PDF- und XML-Dateien in conzept 16 haben Sie nun die Möglichkeit, beim Versand digitaler Dokumente zusätzliche Sicherheit zu gewährleisten. Sie sind damit auch schon einen Schritt im Voraus, wenn dies in bestimmten Bereichen verpflichtend wird. In einigen EU-Staaten ist die digitale Signatur bereits Pflicht. Stand heute müssen in Spanien und Italien bei Business-To-Government E-Rechnungen digital signiert sein.

Klicken Sie hier, um die Nutzungsbedingungen für unseren Blog zu lesen.

Leave a Reply

Your email address will not be published. Required fields are marked *

Leave the field below empty!

Requests, questions or feedback are welcome:

Terms of use of the comment function in the blog

1. General information

Vectorsoft AG (‘Provider’) provides a public blog for Internet users (‘Users’) on the vectorsoft.de website. The public blog is intended for the exchange of information and ideas. Users who participate with contributions and comments undertake to comply with the blog terms of use and are responsible for the accuracy, appropriateness and freedom from legal infringements of their contributions. By using the comment function in our blog, you accept these terms of use.

2. Netiquette

We ask you to refrain from personal attacks and provocations based on other opinions. Please argue objectively and maintain a constructive discussion culture. Your comment should always be related to the topic in question in order to avoid digressions into other topics. Posting the same comment or several similar comments more than once is not permitted.

3. Prohibition of illegal content

By submitting your comment, you confirm that you are not violating any copyrights or other rights of third parties. Inciting, racist statements, instructions for criminal offences and their glorification, depictions of violence, pornographic content and statements that violate personal rights are prohibited.

4. No advertising

The use of the comment function is not permitted for commercial or party-political purposes. Advertising contributions of any kind will be deleted immediately.

5. Details of the name

When entering your name, pay attention to the principles mentioned above.

6. Source references

If you intend to publish quotes or contributions from third parties, please indicate the respective sources and explain how they relate to the blog post.

7. Violation of the terms of use

Posts that violate this policy will be deleted immediately. If you notice any violations yourself, please send us the link to the comment in question by e-mail to . We expressly point out that we will exclude individual users in the event of repeated or serious violations of these terms of use.

As of: Sept. 2024

Get your Trial Version now!

Test yeet free of charge

IHRE EVALUIERUNGSLIZENZ - JETZT ANFORDERN!

TESTEN SIE DIE CONZEPT 16 VOLLVERSION - UNVERBINDLICH und KOSTENFREI

Subscribe to our newsletter

[cleverreach_signup]
WordPress Cookie Notice by Real Cookie Banner