简体   繁体   中英

PKCS11Exception: CKR_HOST_MEMORY

I'm having problems with an application that generates SOAP messages and does some signing using the XMLSignature class from the JDK.

I get this exception:

Caused by: java.security.ProviderException: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_HOST_MEMORY
at sun.security.pkcs11.P11Signature.engineSign(P11Signature.java:547)
at java.security.Signature$Delegate.engineSign(Signature.java:1160)
at java.security.Signature.sign(Signature.java:553)
at org.jcp.xml.dsig.internal.dom.DOMSignatureMethod.sign(DOMSignatureMethod.java:298)
at org.jcp.xml.dsig.internal.dom.DOMXMLSignature.sign(DOMXMLSignature.java:397)
at uz.mm.ehealth.client.sts.HolderOfKeySOAPHandler.handleMessage(HolderOfKeySOAPHandler.java:156)
at uz.mm.ehealth.client.sts.HolderOfKeySOAPHandler.handleMessage(HolderOfKeySOAPHandler.java:85)
at com.sun.xml.internal.ws.handler.HandlerProcessor.callHandleMessage(HandlerProcessor.java:282)
at com.sun.xml.internal.ws.handler.HandlerProcessor.callHandlersRequest(HandlerProcessor.java:123)
at com.sun.xml.internal.ws.handler.ClientSOAPHandlerTube.callHandlersOnRequest(ClientSOAPHandlerTube.java:127)
... 31 more
Caused by: sun.security.pkcs11.wrapper.PKCS11Exception: CKR_HOST_MEMORY
at sun.security.pkcs11.wrapper.PKCS11.C_Sign(Native Method)
at sun.security.pkcs11.P11Signature.engineSign(P11Signature.java:538)
... 40 more

Googling this did not reveal anything, though. Does anyone know what this could mean or how I could debug this further?

Any pointers would be greatly appreciated!

CKR_HOST_MEMORY error is most likely returned by the PKCS#11 library your JRE is using as a "plugin" which performs cryptographic operations (digital signature creation in your case). PKCS#11 libraries are usually provided by the vendors of specialized cryptographic hardware such as smartcards or HSMs and these libraries provide standardized API which can be used by other applications to access such devices in an easy and convenient way.

When you look at PKCS#11 v2.20 specification you will find this description of the error you are getting:

CKR_HOST_MEMORY: The computer that the Cryptoki library is running on has insufficient memory to perform the requested function.

I believe you should contact the vendor of the PKCS#11 library you are using. He should be able to diagnose and resolve your problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM