Check result of setting the serial number

- Add checks for private key types
- Add tests around new checks for types of private keys
2 files changed