From 3e3b37ca4cbc881628a71715b67ac172018cf9f2 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Sun, 21 May 2017 14:28:57 +0200 Subject: gpg4libre: backport OpenPGP signing from master This squashes the following commits: - gpg4libre: share static xmlsec lib between nss and gpg - gpg4libre: fix gpg signature generation - gpg4libre: initial GPG signature validation - gpg4libre: Make signature dialog work with two signing services - gpg4libre: Having this dllpublic should be fine now since it's in inc/ - gpg4libre: fix build, explicit ctor call - gpg4libre: now use the gpg security env - gpg4libre: [API-CHANGE] add certificate kind (X509 vs. OpenPGP) - gpg4libre: List both (x509 and gpg) existing signatures - gpg4libre: Init xmlsec in one place before creating the gpg/x509 services - gpg4libre: write PGPData info, get more metadata out for gpg key - gpg4libre: Fixup unit tests, now that SecurityContext is needed - gpg4libre: Make viewing signatures work for gpg signatures - gpg4libre: some code improvements, add metadata for OpenPGP keys - gpg4libre: make signature impl swappable in-situ during validation - gpg4libre: actually take key from user selection - gpg4libre: fix build for windows and mac Change-Id: I3e36b22cefba4c6195bcf8b85b3f7a2cc101b845 Reviewed-on: https://gerrit.libreoffice.org/39076 Reviewed-by: Katarina Behrens Reviewed-by: Thorsten Behrens Tested-by: Thorsten Behrens --- offapi/UnoApi_offapi.mk | 1 + offapi/com/sun/star/security/CertificateKind.idl | 33 ++++++++++++++++++++++++ offapi/com/sun/star/security/XCertificate.idl | 8 +++++- 3 files changed, 41 insertions(+), 1 deletion(-) create mode 100644 offapi/com/sun/star/security/CertificateKind.idl (limited to 'offapi') diff --git a/offapi/UnoApi_offapi.mk b/offapi/UnoApi_offapi.mk index 0e0a6cad8962..f0e03f2808e1 100644 --- a/offapi/UnoApi_offapi.mk +++ b/offapi/UnoApi_offapi.mk @@ -3316,6 +3316,7 @@ $(eval $(call gb_UnoApi_add_idlfiles,offapi,com/sun/star/security,\ CertificateCharacters \ CertificateContainerStatus \ CertificateException \ + CertificateKind \ CertificateValidity \ CryptographyException \ DocumentSignatureInformation \ diff --git a/offapi/com/sun/star/security/CertificateKind.idl b/offapi/com/sun/star/security/CertificateKind.idl new file mode 100644 index 000000000000..b1ae35e87ded --- /dev/null +++ b/offapi/com/sun/star/security/CertificateKind.idl @@ -0,0 +1,33 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + */ + +#ifndef __com_sun_star_security_CertificateKind_idl_ +#define __com_sun_star_security_CertificateKind_idl_ + +module com { module sun { module star { module security { + +/** + * Enum definition of a certificate kind ( X509, OpenPGP ) + */ +enum CertificateKind +{ + /** X.509 format of a certificate + */ + X509, + + /** OpenPGP format of a certificate + */ + OPENPGP +}; + +} ; } ; } ; } ; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/security/XCertificate.idl b/offapi/com/sun/star/security/XCertificate.idl index 22f7c6a4a1be..6feaa409ccf2 100644 --- a/offapi/com/sun/star/security/XCertificate.idl +++ b/offapi/com/sun/star/security/XCertificate.idl @@ -23,13 +23,14 @@ #include #include #include +#include module com { module sun { module star { module security { /** * Interface of a PKI Certificate * - *

This interface represents a x509 certificate.

+ *

This interface represents a certificate (X.509 or OpenPGP) .

*/ interface XCertificate : com::sun::star::uno::XInterface { @@ -108,6 +109,11 @@ interface XCertificate : com::sun::star::uno::XInterface */ [attribute, readonly] sequence< byte > MD5Thumbprint; + /** + * the kind of certificate, X.509 or OpenPGP + */ + [attribute, readonly] com::sun::star::security::CertificateKind CertificateKind; + /** * Find a extension with a object identifier. */ -- cgit v1.2.3