You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@pulsar.apache.org by Ryan Stout <rs...@box.com> on 2017/11/03 20:53:11 UTC

Pulsar Encryption issues

Hey Pulsar devs,

I've been trying to set-up E2E encryption in Pulsar, following this guide:
https://github.com/apache/incubator-pulsar/blob/
9e3f390c8637c9804c234b01b8b396945a363af1/site/docs/latest/
advanced/Encryption.md

I've followed the steps in the guide, but I'm encountering issues around
the BouncyCastle jar being used at runtime (I assume). For example, I see
the following exception:


Caused by: java.lang.NoSuchFieldError: id_hmacWithSHA3_224
at org.bouncycastle.jcajce.provider.digest.SHA3$Mappings.configure(Unknown
Source)
at
org.bouncycastle.jce.provider.BouncyCastleProvider.loadAlgorithms(Unknown
Source)
at org.bouncycastle.jce.provider.BouncyCastleProvider.setup(Unknown Source)
at org.bouncycastle.jce.provider.BouncyCastleProvider.access$000(Unknown
Source)
at org.bouncycastle.jce.provider.BouncyCastleProvider$1.run(Unknown Source)
at java.security.AccessController.doPrivileged(Native Method)
at org.bouncycastle.jce.provider.BouncyCastleProvider.<init>(Unknown Source)
at
org.apache.pulsar.client.impl.MessageCrypto.<clinit>(MessageCrypto.java:111)


I've been putting BC jars into $JAVA_HOME/jre/lib/ext, adding BC
dependencies to my build, but I haven't been able to fix these runtime
issues.

I think there's either something wrong with my (Scala) build env, or my
system env. Does anyone have any ideas as to what issue might be? Or could
someone perhaps share a simple, sample (gradle) project that creates a
Pulsar producer and produces an encrypted message?

Re: Pulsar Encryption issues

Posted by Sahaya Andrews <an...@apache.org>.
Hi Ryan,

  I am able to build and run SampleCryptoProducer using gradle
following the instruction to build gradle project from
https://spring.io/guides/gs/gradle/.

  You can clone https://github.com/saandrews/pulsarencryption
repository and run "cd initial; ./gradlew build; ./gradlew run". Make
sure to generate the keys and have standalone pulsar running in your
system. Let me know if you are still running into any issue.

Thanks,
Andrews.

On Fri, Nov 3, 2017 at 1:53 PM, Ryan Stout <rs...@box.com> wrote:
> Hey Pulsar devs,
>
> I've been trying to set-up E2E encryption in Pulsar, following this guide:
> https://github.com/apache/incubator-pulsar/blob/9e3f390c8637c9804c234b01b8b396945a363af1/site/docs/latest/advanced/Encryption.md
>
> I've followed the steps in the guide, but I'm encountering issues around the
> BouncyCastle jar being used at runtime (I assume). For example, I see the
> following exception:
>
>
> Caused by: java.lang.NoSuchFieldError: id_hmacWithSHA3_224
> at org.bouncycastle.jcajce.provider.digest.SHA3$Mappings.configure(Unknown
> Source)
> at org.bouncycastle.jce.provider.BouncyCastleProvider.loadAlgorithms(Unknown
> Source)
> at org.bouncycastle.jce.provider.BouncyCastleProvider.setup(Unknown Source)
> at org.bouncycastle.jce.provider.BouncyCastleProvider.access$000(Unknown
> Source)
> at org.bouncycastle.jce.provider.BouncyCastleProvider$1.run(Unknown Source)
> at java.security.AccessController.doPrivileged(Native Method)
> at org.bouncycastle.jce.provider.BouncyCastleProvider.<init>(Unknown Source)
> at
> org.apache.pulsar.client.impl.MessageCrypto.<clinit>(MessageCrypto.java:111)
>
>
> I've been putting BC jars into $JAVA_HOME/jre/lib/ext, adding BC
> dependencies to my build, but I haven't been able to fix these runtime
> issues.
>
> I think there's either something wrong with my (Scala) build env, or my
> system env. Does anyone have any ideas as to what issue might be? Or could
> someone perhaps share a simple, sample (gradle) project that creates a
> Pulsar producer and produces an encrypted message?
>
>
>
>