added check for DER encoded certificate