Oscar,
I posted this message on microsoft.public.office.developer.vba a while back
You can download the files from this location:
http://msdn.microsoft.com/library/d...n-us/security/security/cryptography_tools.asp
Regards,
Lars-Eric
------------------------------------------------------------
Wes,
Below is a reply in a private email to another guy in the news group. The
files mentioned should be included in the Authenticode SDK. You should me
able to download all files you need from msdn.microsoft.com
-------------------------------------------------------
Ok, I'll try to straighten all this out. I understand that all about
certificates can raise a lot of questions.
First of all, there are a number of certificte issuers (also called
Certificate Authorities, CA) that are trusted as issuers. That means in
general that they don't issue certificates to people that can't be traced
back to the issuer (for verification of the certificate, it might be
revoked). If it's a class 3 certificate they take neccessary measurements to
assure the person/company they issue the certificate to really are who they
clain to be. To get a class 3 certificate as a private person you usually
have to indentify yourself with an ID card before you get your certificate,
or are know to the issuer by other means.
Microsoft has picked a number of issuers (CA) as trusted and installed their
root certificates with Windows. To take a look at those root certificates
you (I assume you have the IE icon on your desktop) can right click on the
IE icon on the desktop. Choose properties in the popup menu. Select the
Content tab (I think as I have the Swedish version) and on that page you
should have a button marked Certificates... Click on that button. In the
dialog you get you should select the rightmost tab, marked something like
Trusted Root Certificates. There you have a list trusted root certificates
installed on your computer. Those root certificates are mandatory for
verifying your personal certificates. I'll explain why. When a CA issue a
certificate to you, your certificate will be signed by the CA's root
certificate. If you get a certificate from Verisign it will for sure be
signed by one of the root certificates from Verisign installed on your
computer. We use certificates from Verisign as we know that the root
certificate from Verisign is on all Windows computers.
So, when you have signed something with your client certificate and when
Windows will try verify your certificate it can see which root certificate
your certificate was signed with and tries to verify your certificate
against the root certificate. If your certificates checksum will still match
a new calculated checksum using the root certificate your certificate will
be accepted by windows. That's why you need a root certificate on the
computer so your certificate used for signing can be validated. If the root
certificate is missing your certificate can't be trusted as it can't be
verified against a trusted source. Otherwise you could issue a certificate
to Donald Duck and who would trust that?
To get all working you should create your own root certificate. Create a
folder where you keep your cert util files which will also contain your root
certificate. DON'T forget the passwords you enter during the process!!!!
From the command promt you can type this command:
makecert -n "CN=Your company name" -r -sk mykeystore -ss root rootcert.cer
('-sk mykeystore' will store a private key in your computer for the root
certificate)
You will be asked to install the certificate, you need to accept that to be
able to create the client certificate!
Now you will create your client certificate that will be signed by your root
certificate.
makecert -is root -ic rootcert.cer -sv privatecert.pvk -n "CN=Your Name" -m
24 privatecert.cer
('-m 24' means the certificate will expire after 24 month, industry default
is 12 month and privatecert.pvk will be your private key file)
Now you should have three files; rootcert.cer, privatecert.cer and
privatecert.pvk. The rootcert.cer is the rootcertificate that needs to
installed on all client machines to verify your certificate used when
signing. That's simple, just copy the certificate to each machine and then
just double click on the file and follow the wizard.
Now it's time to create the PFX file that will combine privatecert.cer and
privatecert.pvk into one file so it can be imported to your computers
certificate store and be used for VBA signing. (privatecert.cer and
privatecert.pvk can now be used to sign exe, com, dll, ... files using
signcode.exe)
Use this command at the command promp:
pvkimprt -PFX privatecert.cer privatecert.pvk
Choose to export your private key and a PFX will be the default format. Just
follow the wizard for each step. After the wizard has finnished you should
have your PFX file. Double click on the PFX file to import the certificate.
Choose strong protection in the wizard and not to export the private key.
Now, backup rootcert.cer, privatecert.cer and privatecert.pvk rootcert.cer
will be needed if you want to create a new certificate signed by your root
certificate/key. You can not move the root certificate to another computer
and sign another certificate as the private key is on your computer where
you created the root certificate.
Now you should be ready to sign your VBA projects.
Good luck!
------------------------------------------
Regards,
Lars-Eric
Wes said:
This may not be the correct place to post this, if not
could you point me to where I would ask such questions?
Thanks
My question is this, and forgive me for being so ignorant,
how do I make a certificate that will be valid throughout
our company. So far I only know how to make a certificate
that works on a single computer. We have computers on a
network, as well as standalone. Shouldn't people who open
my file on different computer be asked if they wish to
trust my certificate?
Thanks in advance for helping me out.