Creating a user database
Only valid for TwinCAT 3.1 Build 4024.0: creation of a User DB requires Crypto Version 1 In the TwinCAT version Build 4024.0, a user database for the TwinCAT Software Protection may only be created with an OEM certificate with Crypto version 1! |
Directory for storing user databases User databases must be stored in the following directory in order to be used in the TwinCAT Engineering: C:\TwinCAT\3.1\CustomConfig\UserDBs |
Depending on the TwinCAT version, two different ways of creating a user database are available to you.
- User database can only be created or edited if no project is open. Close any open projects.
- The Software protection configurator is opened.
- 1. If you are using a TwinCAT version < build 4022.25, open the Certificates tab, select the OEM certificate and then click on Create New User DB...
- 2. If you are using a TwinCAT version >= build 4022.25, the Create New User DB... button is additionally available on the Database tab. Here you select the OEM certificate directly in the input mask. Click on Create New User DB…
- The Create new User DB dialog opens.
- 3. Enter a name for the database (Database Name). This name is used in the program to display the selected database.
- 4. Specify a Database Unique Name (for example, with a version number) that enables the unambiguous identification of that database (version) within your organization.
- 5. Enter a name for the administrator of the database. The Database Admin created here is used only to sign the database and cannot be used to log in or to make changes to the database. To make changes to the database, at least one database user must be a member of the administrator group.
- 6. Define the template for the new database.
You should use the TemplateOEM.tcudb template as an easy basis. If your TwinCAT version doesn't contain the template yet, you can download it here: NewTemplate_UserDBV1.0.zip.
To select a different template, click Browse... next to the Database Template box and select the file you want from the Explorer window. - The template is displayed in the Database Template box.
- 7. The database created must initially be signed with a valid OEM certificate. Data from the OEM certificate is also used to generate the User DB key, which unambiguously identifies the individual database.
If the desired certificate is not set in the OEM Certificate File box, select the OEM certificate by clicking on Browse...
The standard directory for the OEM certificate is: c:\twincat\3.1\customconfig\certificates. - The certificate is displayed in the OEM Certificate File box.
- 8. Click on OK.
- You will now be prompted in a dialog to specify a password for the (signing) administrator of the database.
- 9. Enter a password and confirm it by entering it again. Be sure to use a strong password, as otherwise the database will be easy to attack!
- 10. Click on OK.
- 11. Build 4024 only: You will now be prompted to create the second (content-managing) administrator of the database:
You can provide them with the same user name and password as the signing administrator. This makes it easier to manage the database. The user name of the previously created signing administrator is therefore suggested here as the default value.
However, you can also separate the functions of content management (= this administrator) and release of changes (= signing administrator) if you wish.
- 12. Click on OK.
- The database is saved. In a dialog you will be requested to enter the password for the OEM Private Key, with which the database has to be signed in order to be used.
- 13. Enter the password of the OEM certificate and confirm the dialog with OK.
Note: From now on you no longer need the OEM certificate when you work with this database (for example, to make changes to the content). - A further dialog opens with the question whether the database should also be set as the current database in Visual Studio ("activated").
- 14. If so, confirm the dialog with OK.
- This sets the new database as the current database in Visual Studio.
The currently set database is used for the (new) connection of a project to a database.
The database assigned to a project is saved in the project (file name and User DB key).
The database's location is C:\TwinCAT\3.1\CustomConfig\UserDBs.
If you want to define this (or another) database as the default database (which is to be used by default when starting Visual Studio), set it on the Database tab of the configuration window. The procedure is described in the next chapter.