windpapi4j
windpapi4j copied to clipboard
Failed to initialize a WinDPAPI instance on Windows Server 2019 Standard edition
We have created a standalone java utility to encrypt/decrypt the text using WinDP APIs. We are using this library to do the same.
The utility is failed to encrypt or decrypt with the below error. Looks like it was failed at the below statement.
Error: Initialization failed.
Failing statement:
- WinDPAPI winDPAPI = WinDPAPI.newInstance(CryptProtectFlag.CRYPTPROTECT_LOCAL_MACHINE);
This utility is failed on one VM having Windows Server 2019 Standard edition OS. But it is working fine on other VM having the same OS. This utility is also working fine on other OS like Windows Server 2012 R2, Server 2016, etc.
Can someone help to resolve this error? Does it require some pre-req before executing this library?
Kindly help as soon as possible.
We are getting the following errors.

Hello. Have you found a solution to this? We're facing the same problem...
Hi, Write a library in your main project. It helped me.
<dependency>
<groupId>net.java.dev.jna</groupId>
<artifactId>jna</artifactId>
<version>5.10.0</version>
</dependency>
Hello. Have you found a solution to this? We're facing the same problem...
Alright... solved this issue by overriding the JNA dependency version used by WinDPAPI.
Dear All: please try updating to windpapi4j 1.1.0, which pulls the latest JNA library as a dependency. That should solve compatibility issues.