[PR #412] [CLOSED] Add signature file for VBA projects #487

Closed
opened 2026-05-05 12:17:13 -06:00 by gitea-mirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/jmcnamara/libxlsxwriter/pull/412
Author: @HolgiHo
Created: 9/18/2023
Status: Closed

Base: mainHead: add_vba_signature


📝 Commits (2)

  • e84532b add support for adding VBA project signatures:
  • 89a7721 fix indent

📊 Changes

15 files changed (+263 additions, -3 deletions)

View changed files

dev/vba_code_signing/certificate.pfx (+0 -0)
dev/vba_code_signing/create_and_export_certificate.ps1 (+11 -0)
dev/vba_code_signing/import_certificate.ps1 (+6 -0)
📝 docs/src/working_with_macros.dox (+25 -0)
examples/macro_signed.c (+43 -0)
📝 examples/vbaProject.bin (+0 -0)
examples/vbaProjectSignature.bin (+0 -0)
📝 include/xlsxwriter/workbook.h (+28 -1)
📝 src/packager.c (+87 -2)
📝 src/workbook.c (+31 -0)
test/functional/src/images/vbaProject05.bin (+0 -0)
test/functional/src/images/vbaProject05Signature.bin (+0 -0)
test/functional/src/test_macro_signed.c (+29 -0)
📝 test/functional/test_vba.py (+3 -0)
test/functional/xlsx_files/macro_signed.xlsm (+0 -0)

📄 Description

PR for issue #411.

Library changes:

  • workbook: new API function workbook_add_vba_project_signature
  • packager: copy vbaProjectSignature.bin, create vbaProject.bin.rels

Tests:

  • new functional test test_macro_signed

Examples:

  • add examples/macro_signed.c
  • fix examples/vbaProject.bin: Was corrupted; now the button press works again; VBA project is signed by "VBA Code Signing"
  • add examples/vbaProjectSignature.bin: The digitial signature, based on "VBA Code Signing" certificate

Utilities for testing the VBA project is signed correctly:

  • new directory dev/vba_code_signing containing:
    • the "VBA Code Signing" certificate certificate.pfx that was used to sign the VBA project file. This certificate is self-signed and only for testing purposes. The private key is "xlsxwriter". In reality, you would obtain a code signing certificate from an offical Certificate Authority. This process is usually quite complex and expensive.
    • PowerShell scripts for creating, exporting, and importing VBA code signing certificates. Execute import_certificate.ps1 to install certificate.pfx on your computer to test the example VBA project is actually signed in Excel.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/jmcnamara/libxlsxwriter/pull/412 **Author:** [@HolgiHo](https://github.com/HolgiHo) **Created:** 9/18/2023 **Status:** ❌ Closed **Base:** `main` ← **Head:** `add_vba_signature` --- ### 📝 Commits (2) - [`e84532b`](https://github.com/jmcnamara/libxlsxwriter/commit/e84532b5ac7fab433933e617af268ed3530fafe8) add support for adding VBA project signatures: - [`89a7721`](https://github.com/jmcnamara/libxlsxwriter/commit/89a772135fb7c4477bf73a8803cc0d8f953c4dc0) fix indent ### 📊 Changes **15 files changed** (+263 additions, -3 deletions) <details> <summary>View changed files</summary> ➕ `dev/vba_code_signing/certificate.pfx` (+0 -0) ➕ `dev/vba_code_signing/create_and_export_certificate.ps1` (+11 -0) ➕ `dev/vba_code_signing/import_certificate.ps1` (+6 -0) 📝 `docs/src/working_with_macros.dox` (+25 -0) ➕ `examples/macro_signed.c` (+43 -0) 📝 `examples/vbaProject.bin` (+0 -0) ➕ `examples/vbaProjectSignature.bin` (+0 -0) 📝 `include/xlsxwriter/workbook.h` (+28 -1) 📝 `src/packager.c` (+87 -2) 📝 `src/workbook.c` (+31 -0) ➕ `test/functional/src/images/vbaProject05.bin` (+0 -0) ➕ `test/functional/src/images/vbaProject05Signature.bin` (+0 -0) ➕ `test/functional/src/test_macro_signed.c` (+29 -0) 📝 `test/functional/test_vba.py` (+3 -0) ➕ `test/functional/xlsx_files/macro_signed.xlsm` (+0 -0) </details> ### 📄 Description PR for issue #411. Library changes: - `workbook`: new API function `workbook_add_vba_project_signature` - `packager`: copy `vbaProjectSignature.bin`, create `vbaProject.bin.rels` Tests: - new functional test `test_macro_signed` Examples: - add `examples/macro_signed.c` - fix `examples/vbaProject.bin`: Was corrupted; now the button press works again; VBA project is signed by "VBA Code Signing" - add `examples/vbaProjectSignature.bin`: The digitial signature, based on "VBA Code Signing" certificate Utilities for testing the VBA project is signed correctly: - new directory `dev/vba_code_signing` containing: - the "VBA Code Signing" certificate `certificate.pfx` that was used to sign the VBA project file. This certificate is self-signed and only for testing purposes. The private key is "xlsxwriter". In reality, you would obtain a code signing certificate from an offical Certificate Authority. This process is usually quite complex and expensive. - PowerShell scripts for creating, exporting, and importing VBA code signing certificates. Execute `import_certificate.ps1` to install `certificate.pfx` on your computer to test the example VBA project is actually signed in Excel. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
gitea-mirror 2026-05-05 12:17:13 -06:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: github-starred/libxlsxwriter#487
No description provided.