JiriOndrusek commented on code in PR #6241:
URL: https://github.com/apache/camel-quarkus/pull/6241#discussion_r1668627893


##########
extensions-support/bouncycastle/runtime/src/main/java/org/apache/camel/quarkus/support/bouncycastle/BouncyCastleRecorder.java:
##########
@@ -35,11 +34,19 @@ public class BouncyCastleRecorder {
 
     public void registerBouncyCastleProvider(List<String> 
cipherTransformations, ShutdownContext shutdownContext) {
         Provider provider = 
Security.getProvider(SecurityProviderUtils.BOUNCYCASTLE_PROVIDER_NAME);
+        if (provider == null) {
+            provider = 
Security.getProvider(SecurityProviderUtils.BOUNCYCASTLE_FIPS_PROVIDER_NAME);
+        }
         if (provider == null) {
             // TODO: Fix BuildStep execution order so that this is not required
             // https://github.com/apache/camel-quarkus/issues/3472
-            provider = new BouncyCastleProvider();
-            Security.addProvider(provider);
+            try {
+                provider = (Provider) 
Thread.currentThread().getContextClassLoader()
+                        
.loadClass("org.bouncycastle.jce.provider.BouncyCastleProvider").getConstructor().newInstance();
+                Security.addProvider(provider);
+            } catch (Exception e) {
+                // Might happen if bouncy castle in not present (in FIPS 
system)

Review Comment:
   added condition for loading fips provider



##########
docs/modules/ROOT/pages/reference/extensions/crypto-pgp.adoc:
##########
@@ -0,0 +1,55 @@
+// Do not edit directly!
+// This file was generated by 
camel-quarkus-maven-plugin:update-extension-doc-page
+[id="extensions-crypto-pgp"]
+= PGP
+:linkattrs:
+:cq-artifact-id: camel-quarkus-crypto-pgp
+:cq-native-supported: true
+:cq-status: Stable
+:cq-status-deprecation: Stable
+:cq-description: Encrypt and decrypt messages using Java Cryptographic 
Extension (JCE) and PGP.
+:cq-deprecated: false
+:cq-jvm-since: 3.13.0
+:cq-native-since: 3.13.0
+
+ifeval::[{doc-show-badges} == true]
+[.badges]
+[.badge-key]##JVM since##[.badge-supported]##3.13.0## [.badge-key]##Native 
since##[.badge-supported]##3.13.0##
+endif::[]
+
+Encrypt and decrypt messages using Java Cryptographic Extension (JCE) and PGP.
+
+[id="extensions-crypto-pgp-whats-inside"]
+== What's inside
+
+* xref:{cq-camel-components}:dataformats:pgp-dataformat.adoc[PGP data format]
+
+Please refer to the above link for usage and configuration details.
+
+[id="extensions-crypto-pgp-maven-coordinates"]
+== Maven coordinates
+
+https://{link-quarkus-code-generator}/?extension-search=camel-quarkus-crypto-pgp[Create
 a new project with this extension on {link-quarkus-code-generator}, 
window="_blank"]
+
+Or add the coordinates to your existing project:
+
+[source,xml]
+----
+<dependency>
+    <groupId>org.apache.camel.quarkus</groupId>
+    <artifactId>camel-quarkus-crypto-pgp</artifactId>
+</dependency>
+----
+ifeval::[{doc-show-user-guide-link} == true]
+Check the xref:user-guide/index.adoc[User guide] for more information about 
writing Camel Quarkus applications.
+endif::[]
+
+[id="extensions-crypto-pgp-camel-quarkus-limitations"]
+== Camel Quarkus limitations
+
+[id="extensions-crypto-pgp-limitations-fips"]
+=== FIPS
+
+It may not be possible to run `crypto` and `crypto-pgp` extensions together on 
FIPS enabled system.
+For example if `crypro` uses `BCFIPS` provider and `crypto-pgp` uses `BC` 
provider, it is no possible to have bot providers on one classpath.

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscr...@camel.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org

Reply via email to