Improve RFC 3820 compliance of key usage check

I kindly ask that 6840a343ad3c7a1766a0ed8f3dc2a469219d86e7 is merged into the 2.0 branch too.

The second commit simply cleans up the representation of key usage information.