When using the default encryption service provider of JDK 1.8.271 , JDK 1.8 api java.security.Signature is configured with scheme SHA256withECDSA. It is sometimes encoding to ASN.1 DER and sometimes to P1363 BER encoding. Has anybody faced this issue ? What is the solution for the same ?