Public keys that reside inside certificates are only meant to be used for certain things. This is indicated by the Key Usage and Extended Key Usage extensions. The first stop is documentation from OpenSSL. Key usage supported names: digitalSignature nonRepudiation…