Code signing
Microsoft SignTool
Configure KMES Series 3
24min
this section covers general configurations on the {{k3}} to enable signtool to integrate with the {{k}} by using the {{futurex}} cng library then, it shows you how to configure tls communication between the system/host api port on the {{k}} and the {{futurex}} cng library configure general {{k}} settings perform the following tasks to configure the {{k3}} for communication with signtool create a signtool role with the required permissions create a signtool identity with the correct assigned roles enable host api commands create a signing approval group export the code signing certificate export the ca certificate that issued the code signing certificate apply an issuance policy to the code signing certificate the following sections show you how to complete these tasks create a role perform the following steps to create a role for signtool with the required permissions log in to the {{k3}} with the default admin identities go to identity management > roles and select \[ add ] on the info tab, set the type to application , set a name for the role, such as signtool , and set the logins required to 1 on the permissions tab, enable the following permissions permission subpermission certificate authority export, upload keys add on the advanced tab, configure allowed ports to host api only select \[ ok ] to finish creating the role create a new identity and assign it to the signtool role perform the following steps to create a new identity and assign it to the signtool role go to identity management > identities , right click anywhere in the window, and select add > client application on the info tab, set the storage type to application and set a name for the identity, such as signtool on the assigned roles tab, select the signtool role you just created on the authentication tab, remove the default api key mechanism, add the password authentication mechanism, and configure a password select \[ ok ] to finish creating the identity a later section shows how to configure the signtool identity in the fxpkcs11 cfg file to enable the {{futurex}} pkcs #11 library to connect to the {{k3}} enable the host api commands because the {{futurex}} cng library connects to the host api port on the {{k}} , you must define which host api commands to enable for the fxcng library to enable the host api commands required for microsoft signtool operations, complete the following steps log in to the {{k3}} application interface with the default admin identities go to administration > configuration > host api options and enable the following commands command description echo communication test/retrieve version rafa filter issuance policy raga retrieve issuance policy rago retrieve request (hash signing) rauo upload request (hash signing) ragz retrieve request (authenticode) rauz upload request (authenticode) ragj retrieve request (jar signing) rauj upload request (jar signing) rkcp get command permissions rkln lookup objects rklo login user rkrk retrieve generated keys select \[ save ] to finish create a signing approval group perform the following steps to create a signing approval group go to pki > signing workflow and select \[ add approval group ] at the bottom of the page set a name for the approval group , such as signtool , and select \[ ok ] to save right click the signtool approval group and select \[ permission ] give the signtool role the use permission and select \[ ok ] to save create a code signing certificate this section describes three different methods that you can use to issue a code signing certificate use a ca perform the following steps to use a ca on the {{k}} go to pki > certificate authorities and select \[ add ca ] at the bottom of the page in the certificate authority window, enter a name for the certificate container, such as signtool set the owner field to the signtool role and select \[ ok ] right click the signtool certificate container and select add certificate > new certificate on the subject dn tab, set a common name for the certificate, such as root on the basic info tab, leave the fields set to the default values on the v3 extensions tab, select the certificate authority profile and select \[ ok ] the root ca certificate now displays under the signtool certificate container right click the root ca certificate you created and select add certificate > new certificate on the subject dn tab, set a common name for the certificate, such as code signing on the v3 extensions tab, select the code signing certificate profile and select \[ ok ] the code signing certificate now displays under the root ca certificate in the signtool certificate container use an external ca for this method, you must import the external ca certificates into an empty certificate container on the {{k}} then, generate a certificate signing request (csr), which the external ca uses to issue a code signing certificate finally, import the code signing certificate into the certificate container on the {{k}} that contains the external ca certificate go to pki > certificate authorities and select \[ add ca] at the bottom of the page in the certificate authority window, enter a name for the certificate container, such as signtool set the owner field to the signtool role and select \[ ok ] right click the signtool certificate container and select import > certificates in the import certificates window, select \[ add ] and select the external ca certificates for issuing the code signing certificate the ca certificates display in the verified section of the import certificates window select \[ ok ] to save the external ca certificates should now display in tree form under the signtool certificate container to create a placeholder code signing certificate, from which you can generate a csr, right click the lowest level ca certificate in the tree and select add certificate > pending on the subject dn tab of the create x 509 certificate window, set a common name for the certificate, such as code signing on the v3 extensions tab, select the code signing certificate profile select \[ ok ] the code signing placeholder certificate now displays under the external ca certificates right click the placeholder code signing certificate and select export > signing request on the subject dn tab of the create pkcs #10 request window, leave all fields set to the default values 0 on the v3 extensions tab, select the code signing certificate profile on the pkcs #10 info tab, specify a save location for the csr and select \[ ok ] a message box states that the certificate signing request was successfully written to the location you specified send the csr file to an external certificate authority (ca) using the csr, the external ca issues a code signing certificate after the external ca issues the code signing certificate, copy it to the storage medium you configured on the {{k}} in the certificate authorities menu on the {{k}} , right click the placeholder code signing certificate and select replace > with signed certificate in the import certificates window, select \[ add ] and select the externally signed code signing certificate in the file browser the code signing certificate displays under the ca certificates in the verified section of the import certificates window select \[ ok ] to save import an existing certificate to perform the steps in this section, you must go to administration > configuration > options and enable the allow import of certificates using passwords option perform the following steps to import an existing code signing certificate as a pkcs #12 file go to pki > certificate authorities and select \[ add ca ] at the bottom of the page in the certificate authority window, enter a name for the certificate container, such as imported set the owner field to the signtool role and select \[ ok ] right click the imported certificate container, and select import > pkcs12 in the import pkcs12 window, select the pkcs #12 file to import and select \[ next ] input the file password and select \[ next ] select \[ finish ] to initiate the import export the code signing certificate perform the following steps to export the code signing certificate, no matter which of the preceding methods you used to create it go to pki > certificate authorities right click the code signing certificate you configured in the previous section, then select export > certificate(s) change the encoding to pem and select \[ browse ] specify the location where you want to save the file select \[ ok ] to initiate the export export the ca certificate perform the following steps to export the ca certificate that issued the code signing certificate, no matter which method you used to create it go to pki > certificate authorities right click the ca certificate that issued the code signing certificate and select export > certificate(s) change the encoding to pem and select \[ browse ] specify the location where you want to save the file select \[ ok ] to initiate the export repeat steps 1 4 for any additional ca certificates that are in the certificate tree (if applicable) apply an issuance policy perform the following steps to apply an issuance policy to the code signing certificate go to pki > certificate authorities right click the code signing certificate and select issuance policy > add on the basic info tab, set approvals to 0 to allow anonymous signing and select any hashes that you want to allow on the x 509 tab, set the default approval group to signtool on the object signing tab, select the allow object signing checkbox select \[ ok ] to apply the issuance policy to the signtool code signing certificate configure tls communication perform the following tasks to configure tls communication between the {{k3}} and the fxcl cng library create a certificate authority (ca) generate a csr for the system/host api connection pair sign the system/host api csr export the root ca and the signed system/host api tls certificate load the exported certificates into the system/host api connection pair generate a signed client certificate for signtool and fxcng allow export of certificates using passwords export the signed signtool certificate as a pkcs #12 file the following sections describe how to perform these tasks create a ca perform the following steps to create a certificate authority (ca) log in to the {{k3}} application interface with the default admin identities go to pki > certificate authorities and select \[ add ca ] at the bottom of the page in the certificate authority window, enter a name for the certificate container, leave all other fields set to the default values, and select \[ ok ] the new certificate container now displays in the certificate authorities menu right click the certificate container and select add certificate > new certificate on the subject dn tab, set a common name for the certificate, such as system tls ca root on the basic info tab, leave fields set to the default values in the v3 extensions tab, select the certificate authority profile and select \[ ok ] the root ca certificate now displays under the previously created certificate container generate a csr perform the following steps to generate a csr for the system/host api connection pair go to administration > configuration > network options in the network options window, select the tls/ssl settings tab under the system/host api connection pair, uncheck the use futurex certificates checkbox and select \[ edit ] next to pki keys in the user certificates section in the application public keys window, select \[ generate ] when warned that ssl will not be functional until new certificates are imported , select \[ yes ] to continue in the pki parameters window, leave the default settings and select \[ ok ] the application public keys window now shows that a pki key pair is loaded select \[ request ] on the subject dn tab, you can leave the default system/host api value set in the common name field, or you can change it to a different value on the v3 extensions tab, select the tls server certificate profile on the pkcs #10 info tab, select a save location for the csr and select \[ ok ] the main network options window now shows loaded next to pki keys sign the csr perform the following steps to sign the system/host api csr go to pki > certificate authorities right click the root ca certificate you created and select add certificate > from request in the file browser, select the csr that you generated for the system/host api connection pair after it loads, don't modify any settings for the certificate select \[ ok ] the signed system/host api certificate now displays under the root ca certificate on the certificate authorities page export the root ca perform the following steps to export the root ca and signed system/host api tls certificates right click the root ca certificate and select export > certificate(s) change the encoding to pem and select \[ browse ] specify a save location and name for the export file when prompted that the file was successfully written to the location that was selected , select \[ ok ] right click the signed system/host api certificate and select export > certificate(s) change the encoding to pem and select \[ browse ] specify a save location and name for the export file when prompted that the file was successfully written to the location that was selected , select \[ ok ] load the tls certificates perform the following steps to load the exported tls certificates into the system/host api connection pair go to administration > configuration > network options in the network options window, go to the tls/ssl settings tab select \[ edit ] next to certificates in the user certificates section right click the system/host api ssl ca x 509 certificate container and select \[ import ] select \[ add ] at the bottom of the import certificates window in the file browser, select both the root ca certificate and the signed system/host api certificate, and select \[ open ] select \[ ok ] to save the changes in the network options window, the system/host api connection pair shows signed loaded next to certificates in the user certificates section select \[ ok ] to save and exit the network options window generate a tls certificate perform the following steps to generate a signed client tls certificate for signtool and fxcng go to pki > certificate authorities right click the root ca certificate and select add certificate > new certificate on the subject dn tab, set a common name for the certificate, such as signtool leave all fields on the basic info tab set to the default values on the v3 extensions tab, select the tls client certificate profile and select \[ ok ] the signed signtool certificate now displays the root ca certificate allow export of certificates perform the following steps to configure the allow export of certificates by using passwords option go to administration > configuration > options select the checkbox next to the second menu option, allow export of certificates using passwords select \[ save ] export the certificate perform the following steps to export the signed signtool client tls certificate as a pkcs #12 file go to pki > certificate authorities right click the signed signtool client certificate and select export > pkcs12 select \[ set password ] , enter a password for the pkcs #12 file, and select \[ save ] in the export certificate window, select export selected certificate under export options and select \[ next ] specify a name for the pkcs #12 export file and select \[ open ] a message box states that the pkcs #12 certificate export was successful move the signtool certificate and the system tls ca root certificate to the computer that uses the microsoft signtool application a later section configures them in the futurex cng configuration file and uses them for tls communication with the {{k3}}