Existe certificado especial pra assinar programa.
Sinceramente não sei se e-CNPJ vale pra isso.

Moderador: Moderadores
#define CAPICOM_CURRENT_USER_STORE 2
#define CAPICOM_MY_STORE "My"
#define CAPICOM_STORE_OPEN_READ_ONLY 0
#define URL "http://timestamp.verisign.com/scripts/timstamp.dll"
PROCEDURE Main
LOCAL oStore, oSignedCode, oSigner
oStore := win_OleCreateObject( "CAPICOM.Store" )
oSignedCode := win_OleCreateObject( "CAPICOM.SignedCode" )
oSigner := win_OleCreateObject( "CAPICOM.Signer" )
oStore:Open( CAPICOM_CURRENT_USER_STORE, CAPICOM_MY_STORE, CAPICOM_STORE_OPEN_READ_ONLY )
oSignedCode:FileName := "d:\temp\minigui.exe"
oSignedCode:Description := "José M. C. Quintas"
oSignedCode:DescriptionURL := "www.josequintas.com.br"
? oSignedCode:Sign( oSigner )
? oSignedCode:TimeStamp( URL )
? oSignedCode:Verify()
RETURN
#define URL "http://timestamp.verisign.com/scripts/timstamp.dll"
PROCEDURE Main
LOCAL oSignedCode, oSigner
oSignedCode := win_OleCreateObject( "CAPICOM.SignedCode" )
oSigner := win_OleCreateObject( "CAPICOM.Signer" )
oSignedCode:FileName := "d:\temp\test2.exe"
oSignedCode:Description := "José M. C. Quintas"
oSignedCode:DescriptionURL := "www.josequintas.com.br"
? oSignedCode:Sign( oSigner )
? oSignedCode:TimeStamp( URL )
? oSignedCode:Verify()
RETURN
rochinha escreveu:Amiguinhos,
Ainda não entendi o porque da compra de um certificado como o da COMODO para assinar nossos softwares. Os certificados e-CNPJ não servem?
#define URL "http://timestamp.verisign.com/scripts/timstamp.dll"
PROCEDURE Main
LOCAL oSignedCode, oSigner, oElement
oSignedCode := win_OleCreateObject( "CAPICOM.SignedCode" )
oSigner := win_OleCreateObject( "CAPICOM.Signer" )
oSignedCode:FileName := "d:\temp\test2.exe"
oSignedCode:Description := "José M. C. Quintas"
oSignedCode:DescriptionURL := "www.josequintas.com.br"
? oSignedCode:Sign( oSigner )
? oSignedCode:TimeStamp( URL )
? oSignedCode:Verify()
FOR EACH oElement IN oSignedCode:Certificates
? oElement:SubjectName
NEXT
RETURN
NIL
NIL
NIL
CN=COMODO RSA Code Signing CA, O=COMODO CA Limited, L=Salford, S=Greater Manchester, C=GB
CN=J.P.A Tecnologia Ltda. ME., O=J.P.A Tecnologia Ltda. ME., STREET=Rua xxxxxx, L=SÏ€o Paulo, S=SÏ€o
Paulo, PostalCode=03676-080, C=BR
CN=Symantec Time Stamping Services Signer - G4, O=Symantec Corporation, C=US
CN=Symantec Time Stamping Services CA - G2, O=Symantec Corporation, C=US
oSignedCode:DescriptionURL := "www.josequintas.com.br"
// --------------------
oCerts1:=oStore:Certificates()
oCerts2:=oCerts1:Select("Selecione o certificado desejado","Selecione o certificado",.F.)
IF oCerts2:Count() > 0
oCerts3 := oCerts2:Item(1)
//
oSigner := TOleAuto():New( "CAPICOM.Signer" )
oSettings := TOleAuto():New( "CAPICOM.Settings" )
oAssinatura := TOleAuto():New( "CAPICOM.SignedData" )
//
oSigner:Certificate := oCerts2:Item(1)
oSettings:EnablePromptForCertificateUI := .t.
EndIf
// --------------------
? oSignedCode:Sign( oSigner )
PVKIMPRT "d:\tudo\signtool\mycredentials.spc" "d:\tudo\signtool\jpateckey.pvk"
CHROME, SAFARI, EDGE and OPERA WILL NOT WORK with the code signing export process any longer (it now lacks the proper controls to generate and handle the private key). As of June 2016, our order system will not let anyone submit using an unsupported browser. This has nothing to do with support of signatures created with your certificate, it is just a limitation of the key generation at order time. Once exported, all certificates work in all browsers and is completely portable.
Retornar para Contribuições, Dicas e Tutoriais
Usuários vendo este fórum: Nenhum usuário registrado online e 19 visitantes