I try to sign a Office Document with HSM in java. When I use p12 or pfx file. Sign success and no problem. But when I try to use HSM (Utimaco) to do that, I have a Exeption: java.lang.UnsupportedOperationException: Private Exponent value is sensitive. May be in Apache Poi, load private key from HSM is not allowed. I can sign pdf( with itext) ỏ sign XML with HSM => no problem
What should I do in this case?
I hope someone have solution for my case and help me. Thank so much!
This is my method to connect HSM by IAIK. I use sample sign document of POI in github.
And this is sign method: