Extract DER of X.509 extension

Fixes: https://bugzilla.osafoundation.org/show_bug.cgi?id=12948