SALM

ActiveX/OCX Certificate, Cab & Signing

1. makespc.cmd

c:\makecert -sv “pegcert.pvk” -n “CN=Inspint PEG” pegcert.cer
c:\cert2spc pegcert.cer pegcert.spc

 

2.  cab.cmd

c:\cabarc.exe N test.cab test.ocx test.inf

 

3. signcode.cmd

c:\signcode -v pegcert.pvk -spc pegcert.spc pedo.cab
c:\setreg -q 1 TRUE
c:\chktrust pedo.cab

 

4.  TEST.INF

; ========================= test.inf ========================

[version] ; version signature (same for both NT and Win95) do not remove
signature=”$CHICAGO$”
AdvancedINF=2.0

[Add.Code] test.ocx=test.ocx
; These are the necessary supporting DLLs for MFC 4.2 ActiveX Controls
mfc42.dll=mfc42.dll
msvcrt.dll=msvcrt.dll
olepro32.dll=olepro32.dll

; dependent DLLs
[msvcrt.dll] ; This is an example of conditional hook. The hook only gets processed
; if msvcrt.dll of the specified version is absent on client machine.
FileVersion=6,0,8168,0
hook=mfc42installer

[mfc42.dll] FileVersion=6,0,8168,0
hook=mfc42installer

[olepro32.dll] FileVersion=5,0,4261,0
hook=mfc42installer

[mfc42installer] file-win32-x86=<LINK TYPE=”GENERIC” VALUE=”http://activex.microsoft.com
/controls/vc/mfc42.cab”>http://activex.microsoft.com/controls/vc
/mfc42.cab</LINK>
;InfFile=mfc42.inf
; The mfc42.cab file actually contains a self extracting executable.
; In this case we specify a run= command.
run=%EXTRACT_DIR%\mfc42.exe

[test.ocx] file-win32-x86=thiscab
; *** add your controls CLSID here ***
clsid={0D886696-C7CE-11D3-A175-08002BF17507}
; Add your ocx’s file version here.
FileVersion=1,0,0,1
RegisterServer=yes

 

5. INDEX.HTML

<!DOCTYPE HTML PUBLIC “-//W3C//DTD HTML 4.0//EN”>
<html>
<head>
<base target=”detail”>
<title>TaskForce</title>
<meta name=”generator” content=”PEG””>
</head>

<body bgcolor=”white” text=”black” link=”blue” vlink=”purple” alink=”red”>

<p><object classid=”pegcert” codebase=”pedo.CAB#version=8.0.0.0″
width=”300″ height=”330″ id=”test”>
</object>
</p>
</body>

</html>

2 thoughts on “ActiveX/OCX Certificate, Cab & Signing

  1. Bomyung Kim Post author

    [SETUP.INF | PEGRAPH]

    ; INF for GigaSoft ProEssentials v8 Charting Controls
    [version]
    signature=”$CHICAGO$”
    AdvancedINF=2.0

    [Add.Code]
    pego32f.ocx=pego32f.ocx
    pesgo32f.ocx=pesgo32f.ocx
    pepso32f.ocx=pepso32f.ocx
    pepco32f.ocx=pepco32f.ocx
    pe3do32f.ocx=pe3do32f.ocx
    pegrp32f.dll=pegrp32f.dll

    [pego32f.ocx]
    file-win32-x86=thiscab
    Clsid={1DB6261C-B8C7-4D22-9AF0-488786222CBE}
    RegisterServer=Yes
    FileVersion=8,0,0,0

    [pesgo32f.ocx]
    file-win32-x86=thiscab
    Clsid={8083E52F-5FDF-4897-8012-C4860AA22929}
    RegisterServer=Yes
    FileVersion=8,0,0,0

    [pepso32f.ocx]
    file-win32-x86=thiscab
    Clsid={F11DA2E2-2AB4-44C6-A9F1-7C5F95517E6E}
    RegisterServer=Yes
    FileVersion=8,0,0,0

    [pepco32f.ocx]
    file-win32-x86=thiscab
    Clsid={66509446-D29E-4CD3-90BA-AA4AC64ABD42}
    RegisterServer=Yes
    FileVersion=8,0,0,0

    [pe3do32f.ocx]
    file-win32-x86=thiscab
    Clsid={EFBEE46F-62C9-46DC-8BF2-06C3D4C76527}
    RegisterServer=Yes
    FileVersion=8,0,0,0

    [pegrp32f.dll]
    file-win32-x86=thiscab
    RegisterServer=No
    FileVersion=8,0,0,0

  2. Bomyung Kim Post author

    [SETUP.INF | PEGRAPH (Not Working!!!]
    1. C:\Program Files (x86)\Windows Kits\8.0\bin\x86>makecert -sv peg8cert.pvk -n “CN=Inspint” peg8cert.cer
    2. C:\Program Files (x86)\Windows Kits\8.0\bin\x86>cert2spc peg8cert.cer peg8cert.spc
    3. C:\Program Files (x86)\Windows Kits\8.0\bin\x86>pvk2pfx -pvk peg8cert.pvk -pi I****L** -spc peg8cert.spc -pfx peg8cert.pfx -po I****L** -f

    > 29/10/2015 11:33 PM 1,212 peg8cert.pvk
    > 29/10/2015 11:33 PM 567 peg8cert.cer
    > 29/10/2015 11:35 PM 614 peg8cert.spc
    > 30/10/2015 12:07 AM 2,358 peg8cert.pfx

    4. C:\Temp\PEG>signtool sign /f peg8cert.pfx /p I****L** /v peg8.cab
    The following certificate was selected:
    Issued to: Inspint
    Issued by: Root Agency
    Expires: Sun Jan 01 10:59:59 2040
    SHA1 hash: D964F37A18CE90386C682B29CA641B12E032ABAE

    Done Adding Additional Store
    SignTool Error: The signer’s certificate is not valid for signing.
    SignTool Error: An error occurred while attempting to sign: peg8.cab

    Number of files successfully Signed: 0
    Number of warnings: 0
    Number of errors: 1

Leave a Reply