Digitally sign drivers in Ubuntu 17

I cane across the solution when installing Virtual box on Ubuntu but got the old

modprobe: ERROR: could not insert 'vboxdrv': Required key not available

I was having the same issue with my r8152 drivers for my Lenovo Thunderbolt 3 dock

This(https://forums.lenovo.com/t5/Linux-Discussion/X1-5th-and-Thundebolt3-dockstation-no-ethernet-with-Debian/td-p/3730394) article got me 90% of the way to a solution but I wasn’t able to load the driver.

The soltuion was fialry simple. Create a key, trust the key, use the key to sign the driver, reboot, Import the key during the MOK management boot screen, reboot, modprobe the driver, All good :)

https://gorka.eguileor.com/vbox-vmware-in-secureboot-linux/