That is a bit more complex than you might think, because I have to explain how to sign the driver,,, But I will have a go at it,
The code s basically correct, but signing a driver locally is not that straightforward unless you already own a proper (certificate) license from Microsoft.
(And that is a GOOD thing and merely an inconvenience)