title: how to fix error CKR_KEY_TYPE INCONSISTEN
body: <p>I work with Lunasa5 hsm and CA(certificate authority) software(not pen source software). when run software in server that see one slot hsm(the server is client of slot) and I load CSR in software for generate certificate not do it(certificate not generate) and tomcat for software show this error</p>
  
  <pre><code>xx.yy.crypto.CryptoException: java.security.ProviderException: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_KEY_TYPE_INCONSISTENT
          at ir.cto.crypto.SignatureImpl.verify(SignatureImpl.java:74)
          at ir.cto.ca.server.service.CertificateService.verifyTemplateSignature(CertificateService.java:506)
          at ir.cto.ca.server.service.CertificateService.approveCertificateRequest(CertificateService.java:587)
          at ir.cto.ca.server.service.CertificateService.importCertificateRequest(CertificateService.java:1728)
          at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
          at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
          at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
          at java.lang.reflect.Method.invoke(Method.java:597)
          at org.apache.axis.providers.java.RPCProvider.invokeMethod(RPCProvider.java:397)
          at org.apache.axis.providers.java.RPCProvider.processMessage(RPCProvider.java:186)
          at org.apache.axis.providers.java.JavaProvider.invoke(JavaProvider.java:323)
          at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
          at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
          at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
          at org.apache.axis.handlers.soap.SOAPService.invoke(SOAPService.java:454)
          at org.apache.axis.server.AxisServer.invoke(AxisServer.java:281)
          at org.apache.axis.transport.http.AxisServlet.doPost(AxisServlet.java:699)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:710)
          at org.apache.axis.transport.http.AxisServletBase.service(AxisServletBase.java:327)
          at javax.servlet.http.HttpServlet.service(HttpServlet.java:803)
          at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
          at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
          at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
          at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:175)
          at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:128)
          at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
          at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
          at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:263)
          at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:844)
          at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:584)
          at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:447)
          at java.lang.Thread.run(Thread.java:662)
  </code></pre>
  
  <p>how do fix it?</p>