Properly encode IMPLICIT tag
Fix both explicit and implicit tags for submodel
rfc-3280: fix Certificate encoding