windpapi4j icon indicating copy to clipboard operation
windpapi4j copied to clipboard

Failed to initialize a WinDPAPI instance on Windows Server 2019 Standard edition

Open nagesh2188 opened this issue 3 years ago • 3 comments

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.

image

nagesh2188 avatar Feb 02 '22 08:02 nagesh2188

Hello. Have you found a solution to this? We're facing the same problem...

Unavailable-usernm avatar Feb 28 '22 07:02 Unavailable-usernm

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>

barkep avatar Mar 02 '22 08:03 barkep

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.

Unavailable-usernm avatar Mar 03 '22 09:03 Unavailable-usernm

Dear All: please try updating to windpapi4j 1.1.0, which pulls the latest JNA library as a dependency. That should solve compatibility issues.

peter-gergely-horvath avatar Mar 08 '23 19:03 peter-gergely-horvath