ActiveX release steps

Source: Internet
Author: User
1. Digital Signature. To use signcode.exe to sign a digital signature, follow these steps:
The toolkit includes the following software: (C:/program files/Microsoft Visual Studio. NET 2003/common7/tools/bin directory)
Makecert.exe creates a certificate in cer format, that is, an X.509 Certificate. You can also create a private key.
Cert2spc.exe converts a CER certificate to a SPC certificate, that is, a PKCS #7 certificate.
Signcode.exe sign the certificate to OCX
Chktrust.exe check whether OCX after signing the certificate is correct
There is also a certmgr.exe, which is used to manage certificates. You can export root. cer from this file. Many articles on the Internet write this certificate, but it cannot be found in the installation disk of VC.

To. In fact, it does not matter. These software can be found in the installation disk of VC.

The procedure is as follows:
1. Create a certificate file:
Makecert/SV "wwx. PVK"/N "cn = yourcompant" wwx. Cer
Makecert/SV "wwx. PVK"/N "cn = company name, E = Email, O = Author" wwx. Cer
Here, record. PVK indicates the name of the newly created private key.
Yourcompant is the name of the company you want to display
Wwx. CER is the final certificate file name you have created
Based on your requirements, the wwx. PVK and wwx. Cer files are obtained.
During the operation, you must enter the password of the private key. Make sure that the password is consistent and do not make any mistakes.

2. Convert the CER format to the SPC format (which can be omitted)
Cert2spc wwx. Cer wwx. SPC
Obtain the wwx. SPC file.

3. Sign OCX
When I run signcode, I did not test the command line. I implemented it through the interface.
After running signcode, the digital signature Wizard will appear. First, select the OCX you want to sign. Then, the signature option will appear, either Typical or custom. Select Custom

In this way, select the certificate from the file, select the dream. SPC created earlier, and then click
Select the private key file, select record. PVK, enter the password of the private key, and select the hash algorithm. Generally, you can use MD5. The next step is to select another certificate.

Step 1: Fill in the declaration of this control. When you use IE to browse, the certificate description will pop up, and the next step is to stamp the timestamp. If necessary, use the following address:

Http://timestamp.verisign.com/scripts/timstamp.dll requirements have been online and can go abroad, and then the next step to complete.

4. Check whether chktrust is correct.
Chktrust-V recordproj. ocx

In this way, a test certificate is obtained. Although it is only a test certificate, at least make sure that ocx can pop up a window during ie browsing and ask if you want to install it, instead of directly disabling it.

5. Create an INF file

[Version]
Signature = "$ China $"
Advancedinf = 2.0

[Add. Code]
Weboffice. ocx = weboffice. ocx
Mfc70.dll = mfc70.dll
Msvcrt. dll = msvcrt. dll
Olepro32.dll = olepro32.dll

[Mfc70.dll]
File-win32-x86 = thiscab
Fileversion = 7,0, 9466,0
Destdir = 11
Registerserver = Yes

[Msvcrt. dll]
File-win32-x86 = thiscab
Fileversion = 6, 1, 9844,0
Destdir = 11
Registerserver = Yes

[Olepro32.dll]
File-win32-x86 = thiscab
Fileversion = 5, 0, 4522,0
Destdir = 11
Registerserver = Yes

[Weboffice. ocx]
File-win32-x86 = thiscab
CLSID = {05430ec0-69ca-437a-b1f9-4b78b8647bea}
Fileversion =
Registerserver = Yes
;

Note: If you select static compilation based on MFC, you do not need to configure the dynamic Runtime Library.

6. Create a cab file
Cabarc-s 6144 n weboffice. Cab msvcrt. dll msvcp70.dll msvcr70.dll mfc70.dll olepro32.dll asycfilt. dll stdole2.tlb weboffice. ocx weboffice. inf

Use code signing Wizard to sign a cab file
Signcode.exe
Timestamp service: Verisign time server, which is free. http://timestamp.verisign.com/scripts/timstamp.dll

7,
Edit the webpage activex.htm after completion

<Object ID = dweboffice style = "Left: 0px; width: 100%; top: 0px; Height: pixel PX;" classid = "CLSID: Hangzhou" viewastext codebase = "http: // 127.0.0.1: 9000/ActiveX/weboffice. cab # version = 1, 0, 1 ">

Note the URL address of the object tag codebase parameter in the webpage and the version number specified by # version

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.