Failed to read key - DerValue.getBigIntegerInternal, not expected 48

While creating a mobile build I get this error.
Any idea of what might be causing it and how to fix it?

* What went wrong:
Execution failed for task ':app:signReleaseBundle'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.FinalizeBundleTask$BundleToolRunnable
 > Failed to read key <email> from store "/certificates/android.keystore": DerValue.getBigIntegerInternal, not expected 48

I guess that the keyword to find the problem starts here:
“DerValue.getBigIntegerInternal, not expected 48”

How did you generate your certificates?