访问被拒绝loadLibrary java.lang.RuntimePermission java.security.AccessControlException

时间:2019-06-06 13:08:59

标签: java java-native-interface applet

我需要按照此处所述为NHS实施智能卡身份验证。 https://developer.nhs.uk/apis/spine-core/smartcards.html

我遇到以下错误。

访问被拒绝(“ java.lang.RuntimePermission”“ loadLibrary.TicketApiDll”) java.security.AccessControlException:访问被拒绝(“ java.lang.RuntimePermission”“ loadLibrary.TicketApiDll”)

我创建了示例小程序并尝试执行。如NHS UK所述,Applet正在使用jar文件的类路径执行。

  import java.applet.*;
    import java.awt.*;
    import com.gemplus.gemauth.api.GATicket;
    public class AuthenticateExample extends Applet {

          public void paint(Graphics g)
          {
              try{
              String str = this.getParameter("msg");
              g.drawString("asdasdasdasdsad",200,80);   
              //g.drawString(str,100,80);   
              g.drawString(authenticate(),100,80);  
              }
             catch(Exception e)  
            {  
                System.out.println("Exception Aamir");  
                System.out.println(e);  
            }  
          }
          public String authenticate() throws Exception {
            GATicket gat = new GATicket();
            String ticket = gat.getTicket();
            return ticket;

        }

}

<HTML>
<HEAD>
<TITLE> A Simple Program </TITLE>
</HEAD>
<BODY>

Here is the output of my program:

<applet code="AuthenticateExample" ARCHIVE="GATicket.jar"  WIDTH="300" HEIGHT="200">
<PARAM name="msg" value="hi aamir love">
</applet> 
</APPLET>
</BODY>
</HTML>

我需要NHS网站中提到的令牌。

编辑

grant codeBase "file:///F:/Projects/Java/GATicket.JAR" {
      permission java.security.AllPermission;
};

已按照其他帖子的描述进行了添加。

0 个答案:

没有答案
相关问题