encodeToDerOrNull

Exception-free version of encodeToDer