@@ -292,20 +292,30 @@ that are NOT compatible with FIPS 140-2 validated cryptographic library (`org.bo
292292There are two ways of ensuring that decryption operation is FIPS-compiant.
293293
2942941 . You can provide a custom implementation of the ` IPrivateKeyDecryptor ` interface,
295- which performs the decryption operation using FIPS-certified library of your choice. The interface requires the
296- implementation of just one method:
295+ which performs the decryption operation using FIPS-certified library of your choice.
296+ ` IPrivateKeyDecryptor ` interface is availiable both in ` com.box.sdk ` and ` com.box.sdkgen ` packages.
297+ The interface requires the implementation of just one method:
297298``` java
298299PrivateKey decryptPrivateKey(String encryptedPrivateKey, String passphrase);
299300```
300- After implementing the custom decryptor, you need to set your custom decryptor class in the Box Config.
301- Below is an example of setting up a ` BoxDeveloperEditionAPIConnection ` with a config file and the custom decryptor.
301+ After implementing the custom decryptor, you need to set your custom decryptor class:
302+
303+ - For ` com.box.sdk ` package, you can set the custom decryptor in the ` BoxConfig ` object
304+ before creating the ` BoxDeveloperEditionAPIConnection ` .
302305``` java
303306Reader reader = new FileReader (JWT_CONFIG_PATH );
304307BoxConfig boxConfig = BoxConfig . readFrom(reader);
305308boxConfig. setPrivateKeyDecryptor(customDecryptor);
306309BoxDeveloperEditionAPIConnection api = BoxDeveloperEditionAPIConnection . getAppEnterpriseConnection(boxConfig);
307310```
308311
312+ - For ` com.box.sdkgen ` package, you can set the custom decryptor in the ` JWTConfig ` object
313+ ``` java
314+ JWTConfig newConfig = JWTConfig . fromConfigFile(JWT_CONFIG_PATH , customDecryptor);
315+ BoxJWTAuth auth = new BoxJWTAuth (jwtConfig);
316+ BoxClient client = new BoxClient (auth);
317+ ```
318+
3093192 . Alternative method is to override the Bouncy Castle libraries to the v.1.57 version,
310320which are compatible with the FIPS 140-2 validated cryptographic library (` org.bouncycastle:bc-fips ` ).
311321
0 commit comments