Fixed logic error with .crt and .key protection