Created attachment 39519 [details] Exception 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) or sign XML with HSM => no problem What should I do in this case? My sample: OPCPackage pkg = null; try{ pkg=OPCPackage.open(tempDoc); }catch(InvalidFormatException ex){ ex.printStackTrace(); } ProviderConfig providerConfig=new ProviderConfig(cryptoSource.getModule(),cryptoSource.getSlot(), cryptoSource.getPin()); Provider provider=providerConfig.getProvider(); Security.addProvider(provider); SignatureConfig sic=new SignatureConfig(); sic.setKey(keyAndCert.getPrivateKey()); sic.setDigestAlgo(HashAlgorithm.sha256); sic.setSigningCertificateChain(Collections.singletonList(keyAndCert.getCertificate())); sic.setIncludeEntireCertificateChain(false); sic.setSignatureDescription("Thích"); sic.setExecutionTime(new Date()); sic.setXadesDigestAlgo(HashAlgorithm.sha256); SignatureInfo si=new SignatureInfo(); si.setSignatureConfig(sic); si.setOpcPackage(pkg); boolean isValid=si.verifySignature(); log.error("verifySignature: {} ",isValid); si.confirmSignature();