java.security.AccessControlException: access denied (“java.security.SecurityPermission” “authProvider.SunMSCAPI”)

前端 未结 3 712
粉色の甜心
粉色の甜心 2020-12-09 22:53

Till morning everything working fine in my applet. I took Java update and everything stopped. I\'m dealing with digital certificate using applet. Here is my stack trace. I f

相关标签:
3条回答
  • 2020-12-09 23:33

    I know it's pretty late to answer here, but adding my solution as I had a tough time with this:

    My Issue: While deploying an application (a WAR file) that has dependencies on Bouncy Castle libraries, I faced this issue: `

    cannot create instance of
    org.bouncycastle.jcajce.provider.digest.GOST3411$Mappings
     java.security.AccessControlException: access denied
    ("java.security.SecurityPermission"
    "putProviderProperty.BC")
    

    `

    Here is what I did and it worked for me: Go to: {Installed JDK path}\jre\lib\security\ Open the file java.policy

    Add permission: permission java.security.SecurityPermission "putProviderProperty.BC";

    Restart the programs to load the changes.

    I am yet to understand how exactly this works or if it is safe to just change java.policy file like this (still looking for other ways to achieve such a configuration).

    Do take precautions with such a change. More at Oracle's doc

    0 讨论(0)
  • 2020-12-09 23:36

    Issue:

    java.security.AccessControlException: access denied ("java.security.SecurityPermission" "authProvider.SunMSCAPI")
        at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472)
    

    It is because we needs permission to access file system resources, but an unsigned applet is denied this permission by default. So, to overcome this, the applet must be signed.

    Simply you need to signed your applet jar file.

    Signed jar file

    0 讨论(0)
  • 2020-12-09 23:39

    I cannot comment yet so am putting this as an answer instead.

    1. I believe creating the .java.policy file in your applet will be too late - the plugin will have already started up and read the policy files before running any of your code.

    2. You could sign your applet and use a jnlp file to assign permissions in the security element

    0 讨论(0)
提交回复
热议问题