Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.java.programmer > #32600 > unrolled thread

Anyone know how to set up a bouncycastle?

Started bye.d.programmer@gmail.com
First post2015-09-17 10:51 -0700
Last post2015-09-18 10:26 -0400
Articles 5 — 3 participants

Back to article view | Back to comp.lang.java.programmer


Contents

  Anyone know how to set up a bouncycastle? e.d.programmer@gmail.com - 2015-09-17 10:51 -0700
    Re: Anyone know how to set up a bouncycastle? Arne Vajhøj <arne@vajhoej.dk> - 2015-09-17 22:36 -0400
      Re: Anyone know how to set up a bouncycastle? e.d.programmer@gmail.com - 2015-09-18 05:45 -0700
        Re: Anyone know how to set up a bouncycastle? Arne Vajhøj <arne@vajhoej.dk> - 2015-09-18 20:04 -0400
    Re: Anyone know how to set up a bouncycastle? Jeff Higgins <jeff@invalid.invalid> - 2015-09-18 10:26 -0400

#32600 — Anyone know how to set up a bouncycastle?

Frome.d.programmer@gmail.com
Date2015-09-17 10:51 -0700
SubjectAnyone know how to set up a bouncycastle?
Message-ID<5e5ff34b-8293-469c-abd6-10bc2a9f850b@googlegroups.com>
I'm trying to read a PDF using pdfbox, and on one system I get this error:

cannot create instance of org.bouncycastle.jcajce.provider.digest.GOST3411$Mappings : java.security.AccessControlException: access denied ("java.security.SecurityPermission" "putProviderProperty.BC")
java.lang.InternalError: cannot create instance of org.bouncycastle.jcajce.provider.digest.GOST3411$Mappings : java.security.AccessControlException: access denied ("java.security.SecurityPermission" "putProviderProperty.BC")
org.bouncycastle.jce.provider.BouncyCastleProvider.loadAlgorithms(Unknown Source)
org.bouncycastle.jce.provider.BouncyCastleProvider.setup(Unknown Source)
org.bouncycastle.jce.provider.BouncyCastleProvider.access$000(Unknown Source)
org.bouncycastle.jce.provider.BouncyCastleProvider$1.run(Unknown Source)
java.security.AccessController.doPrivileged(Native Method)
org.bouncycastle.jce.provider.BouncyCastleProvider.<init>(Unknown Source)
org.apache.pdfbox.pdmodel.encryption.SecurityHandlerFactory.<clinit>(SecurityHandlerFactory.java:44)
org.apache.pdfbox.pdmodel.encryption.PDEncryption.<init>(PDEncryption.java:96)
org.apache.pdfbox.pdfparser.PDFParser.prepareDecryption(PDFParser.java:436)
org.apache.pdfbox.pdfparser.PDFParser.initialParse(PDFParser.java:321)
org.apache.pdfbox.pdfparser.PDFParser.parse(PDFParser.java:373)
org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:890)
org.apache.pdfbox.pdmodel.PDDocument.load(PDDocument.java:821)

[toc] | [next] | [standalone]


#32601

FromArne Vajhøj <arne@vajhoej.dk>
Date2015-09-17 22:36 -0400
Message-ID<mtftbo$l9h$2@speranza.aioe.org>
In reply to#32600
On 9/17/2015 1:51 PM, e.d.programmer@gmail.com wrote:
> I'm trying to read a PDF using pdfbox, and on one system I get this
> error:
>
> cannot create instance of
> org.bouncycastle.jcajce.provider.digest.GOST3411$Mappings :
> java.security.AccessControlException: access denied
> ("java.security.SecurityPermission" "putProviderProperty.BC")
> java.lang.InternalError: cannot create instance of
> org.bouncycastle.jcajce.provider.digest.GOST3411$Mappings :
> java.security.AccessControlException: access denied
> ("java.security.SecurityPermission" "putProviderProperty.BC")
> org.bouncycastle.jce.provider.BouncyCastleProvider.loadAlgorithms(Unknown
> Source)
> org.bouncycastle.jce.provider.BouncyCastleProvider.setup(Unknown
> Source)
> org.bouncycastle.jce.provider.BouncyCastleProvider.access$000(Unknown
> Source)
> org.bouncycastle.jce.provider.BouncyCastleProvider$1.run(Unknown
> Source) java.security.AccessController.doPrivileged(Native Method)
> org.bouncycastle.jce.provider.BouncyCastleProvider.<init>(Unknown
> Source)
> org.apache.pdfbox.pdmodel.encryption.SecurityHandlerFactory.<clinit>(SecurityHandlerFactory.java:44)

Wild guess - in your java.security.policy add this permission:

grant {
    permission java.security.SecurityPermission "putProviderProperty.BC";
    ...
};

Arne

[toc] | [prev] | [next] | [standalone]


#32602

Frome.d.programmer@gmail.com
Date2015-09-18 05:45 -0700
Message-ID<7f470fb8-11e6-4773-92fd-027032f9b441@googlegroups.com>
In reply to#32601
On Thursday, September 17, 2015 at 10:37:00 PM UTC-4, Arne Vajhøj wrote:
> Wild guess - in your java.security.policy add this permission:
> 
> grant {
>     permission java.security.SecurityPermission "putProviderProperty.BC";
>     ...
> };
> 
> Arne

I looked up where and how to put this grant stuff.  This sounds complicated.
https://docs.oracle.com/javase/8/docs/technotes/guides/security/PolicyFiles.html#FileSyntax

I'm running webstart.  This should work for my client and server?  I just have to update the server?  This goes in the jdk1.8.0_60\jre\lib\security\java.security file?  I have to manually put this here for each server, and do it again any time we install a new Java version?
I put this in my jnlp file.  It apparently didn't help this issue.
<security>
     <all-permissions/>
</security>
Is there a way to make this work without manually editing files we'll have to worry about later?  This is just for an application, server and clients are all on local network.

Is there a way to call PDDocument.load without using BouncyCastle, or without installing it in java security?

[toc] | [prev] | [next] | [standalone]


#32614

FromArne Vajhøj <arne@vajhoej.dk>
Date2015-09-18 20:04 -0400
Message-ID<mti8pq$3vp$1@speranza.aioe.org>
In reply to#32602
On 9/18/2015 8:45 AM, e.d.programmer@gmail.com wrote:
> On Thursday, September 17, 2015 at 10:37:00 PM UTC-4, Arne Vajhøj
> wrote:
>> Wild guess - in your java.security.policy add this permission:
>>
>> grant { permission java.security.SecurityPermission
>> "putProviderProperty.BC"; ... };
>
> I looked up where and how to put this grant stuff.  This sounds
> complicated.
> https://docs.oracle.com/javase/8/docs/technotes/guides/security/PolicyFiles.html#FileSyntax
>
>  I'm running webstart.  This should work for my client and server?  I
> just have to update the server?  This goes in the
> jdk1.8.0_60\jre\lib\security\java.security file?  I have to manually
> put this here for each server, and do it again any time we install a
> new Java version? I put this in my jnlp file.  It apparently didn't
> help this issue. <security> <all-permissions/> </security> Is there a
> way to make this work without manually editing files we'll have to
> worry about later?  This is just for an application, server and
> clients are all on local network.
>
> Is there a way to call PDDocument.load without using BouncyCastle, or
> without installing it in java security?

I don't know anything about that library.

But JCE providers and Java Web Start are a well-known issue.

http://lopica.sourceforge.net/faq.html#jce has the basic information.

http://stackoverflow.com/questions/4275005/jnlp-applet-bouncy-castle has 
some suggestions.

http://wiki.nikhef.nl/grid/JGridstart/Bouncycastle_and_Java_Web_start 
has another suggestion.

It seems like it do work, but that it requires some effort.

Arne

[toc] | [prev] | [next] | [standalone]


#32603

FromJeff Higgins <jeff@invalid.invalid>
Date2015-09-18 10:26 -0400
Message-ID<mth6tl$l58$1@dont-email.me>
In reply to#32600
On 09/17/2015 01:51 PM, e.d.programmer@gmail.com wrote:
> I'm trying to read a PDF using pdfbox, and on one system I get this error:

PDFBox project has a fairly active mailing list.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.java.programmer


csiph-web