Closed HolgiHo closed 11 months ago
Will open another PR with some fixes.
Thanks for that. It was only requested once but I think it is a useful feature. Some comments.
workbook
: new API functionworkbook_add_vba_project_signature
I think a better function name would be workbook_add_signed_vba_project_signature(lxw_workbook *self, const char *vba_project, const char *signature)
.
It could call workbook_add_vba_project()
internally to add the vba macros/project.
packager: copy vbaProjectSignature.bin, create vbaProject.bin.rels
Ok.
new functional test test_macro_signed
Good. But you could just call it test_macro04
.
add examples/macro_signed.c
You can omit the example. It isn't common enough or complicated enough to need one.
fix examples/vbaProject.bin: Was corrupted; now the button press works again;
I haven't had any report that it is corrupted and I just tested it again and it seems to work fine. So you can omit this change (or figure out if it is a Windows issue).
Utilities for testing the VBA project is signed correctly:
Ok.
I'll make other comments inline if needed.
I think a better function name would be
workbook_add_signed_vba_project_signature(lxw_workbook *self, const char *vba_project, const char *signature)
.
Do you mean workbook_add_signed_vba_project
(without "signature)?
It could call
workbook_add_vba_project()
internally to add the vba macros/project.
Ok.
fix examples/vbaProject.bin: Was corrupted; now the button press works again; I will double-check.
Please check out PR #415 as I have fixed the git commit message there.
PR for issue #411.
Library changes:
workbook
: new API functionworkbook_add_vba_project_signature
packager
: copyvbaProjectSignature.bin
, createvbaProject.bin.rels
Tests:
test_macro_signed
Examples:
examples/macro_signed.c
examples/vbaProject.bin
: Was corrupted; now the button press works again; VBA project is signed by "VBA Code Signing"examples/vbaProjectSignature.bin
: The digitial signature, based on "VBA Code Signing" certificateUtilities for testing the VBA project is signed correctly:
dev/vba_code_signing
containing: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.import_certificate.ps1
to installcertificate.pfx
on your computer to test the example VBA project is actually signed in Excel.