新版 ukey 问题调试
This commit is contained in:
@@ -0,0 +1 @@
|
||||
.idea/
|
||||
+436
@@ -0,0 +1,436 @@
|
||||
* {
|
||||
margin: 0;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
html {
|
||||
overflow-x: hidden;
|
||||
background-color: #b9dad8;
|
||||
}
|
||||
|
||||
body {
|
||||
line-height: 120%;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
header{
|
||||
background: #39c5bb;
|
||||
padding: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
.footer{
|
||||
height: 25%;
|
||||
width: 100%;
|
||||
/*position: fixed;*/
|
||||
bottom: 0px;
|
||||
z-index: 9999;
|
||||
background-color: #b9dad800;
|
||||
}
|
||||
.footconsole{
|
||||
display: block;
|
||||
width:100%;
|
||||
height: 100%;
|
||||
border-radius: 3px;
|
||||
border:2px solid rgba(203, 93, 93, 0.25);
|
||||
}
|
||||
.footclear{
|
||||
height: 20px;
|
||||
background:#39c5bb;
|
||||
color:white;
|
||||
border: 1px solid #39c5bb;
|
||||
border-radius: 2px;
|
||||
cursor: pointer;
|
||||
font-weight: 500;
|
||||
font-size: 5px;
|
||||
float: right;
|
||||
}
|
||||
|
||||
.title{
|
||||
font-size: 25px;
|
||||
text-align: center;
|
||||
}
|
||||
.menu{
|
||||
margin-top:20px;
|
||||
margin-bottom:10px;
|
||||
}
|
||||
.menu li{
|
||||
display: inline-block;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.menu li a{
|
||||
color:black;
|
||||
text-decoration: none;
|
||||
padding:3px;
|
||||
font-weight: 900;
|
||||
}.active {
|
||||
border-bottom:3px solid black;
|
||||
}
|
||||
|
||||
main {
|
||||
padding: 30px 50px 30px 50px;
|
||||
}
|
||||
.content{
|
||||
margin:15px auto;
|
||||
padding:10px;
|
||||
border-radius: 5px;
|
||||
}
|
||||
.s1 {
|
||||
background-color: #41817c;
|
||||
color:white;
|
||||
}
|
||||
|
||||
.nav-Service{
|
||||
float: left;
|
||||
height: 440px;
|
||||
overflow-y: auto;
|
||||
width: 5%;
|
||||
}
|
||||
.nav-btn{
|
||||
margin: 0;
|
||||
float: left;
|
||||
height: 50px;
|
||||
width:125%;
|
||||
background:#39c5bb;
|
||||
color:white;
|
||||
border: 2px solid rgb(0, 0, 0, 0.2);
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
font-weight: 900;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.serviceForm{
|
||||
float: right;
|
||||
border: 1px solid rgb(0, 0, 0, 0.2);;
|
||||
border-radius: 5px;
|
||||
/* height: 440px; */
|
||||
overflow-y: auto;
|
||||
width: 95%;
|
||||
}
|
||||
.serviceForm::-webkit-scrollbar {
|
||||
width:10px;
|
||||
height: 1px;
|
||||
}
|
||||
.serviceForm::-webkit-scrollbar-thumb {
|
||||
border-radius: 10px;
|
||||
box-shadow:inset 0 0 5px rgb(0, 0, 0, 0.2);
|
||||
background-color: #535353;
|
||||
}
|
||||
.serviceForm::-webkit-scrollbar-track {
|
||||
border-radius: 10px;
|
||||
box-shadow:inset 0 0 5px rgb(0, 0, 0, 0.2);
|
||||
background-color: #EDEDED;
|
||||
}
|
||||
@media screen and (max-height : 1500px) {
|
||||
.serviceForm{height: 720px;}
|
||||
}
|
||||
@media screen and (max-height : 1000px) {
|
||||
.serviceForm{height: 580px;}
|
||||
}
|
||||
@media screen and (max-height : 760px) {
|
||||
.serviceForm{height: 440px;}
|
||||
}
|
||||
|
||||
.form-service {
|
||||
float: left;
|
||||
height: 440px;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.form1 {
|
||||
float: left;
|
||||
border: 1px solid rgb(0, 0, 0, 0.2);;
|
||||
border-radius: 5px;
|
||||
height: 440px;
|
||||
overflow-y: auto;
|
||||
width: 100%;
|
||||
}
|
||||
.form1::-webkit-scrollbar {
|
||||
width:10px;
|
||||
height: 1px;
|
||||
}
|
||||
.form1::-webkit-scrollbar-thumb {
|
||||
border-radius: 10px;
|
||||
box-shadow:inset 0 0 5px rgb(0, 0, 0, 0.2);
|
||||
background-color: #535353;
|
||||
}
|
||||
.form1::-webkit-scrollbar-track {
|
||||
border-radius: 10px;
|
||||
box-shadow:inset 0 0 5px rgb(0, 0, 0, 0.2);
|
||||
background-color: #EDEDED;
|
||||
}
|
||||
.checkarea{
|
||||
display: table;
|
||||
}
|
||||
.form-group {
|
||||
margin:10px auto;
|
||||
margin-top: 0px;
|
||||
border-radius: 5px;
|
||||
width: 85%;
|
||||
background-color: rgb(100, 71, 155);
|
||||
color:white;
|
||||
}
|
||||
|
||||
input[type='date'],
|
||||
input[type='email']{
|
||||
display: block;
|
||||
padding:8px;
|
||||
width:80%;
|
||||
border-radius: 3px;
|
||||
border:2px solid rgba(203, 93, 93, 0.25);
|
||||
margin-top:3px;
|
||||
}
|
||||
input[type='password'] {
|
||||
padding:8px;
|
||||
float: left;
|
||||
width:95%;
|
||||
border-radius: 3px;
|
||||
border:2px solid rgba(203, 93, 93, 0.25);
|
||||
margin-top:3px;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
input[type='text'] {
|
||||
padding:8px;
|
||||
float: left;
|
||||
width:95%;
|
||||
border-radius: 3px;
|
||||
border:2px solid rgba(203, 93, 93, 0.25);
|
||||
margin-top:3px;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
input[type='text1'] {
|
||||
padding:8px;
|
||||
float: left;
|
||||
width:30%;
|
||||
border-radius: 3px;
|
||||
border:2px solid rgba(203, 93, 93, 0.25);
|
||||
margin-top:3px;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
input[type='textCon'] {
|
||||
background-color: #459792;
|
||||
color: #EDEDED;
|
||||
font-size: medium;
|
||||
font-weight: 700;
|
||||
cursor:default;
|
||||
padding:8px;
|
||||
float: left;
|
||||
width:30%;
|
||||
border-radius: 3px;
|
||||
border:2px solid rgba(203, 93, 93, 0.25);
|
||||
margin-top:3px;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
|
||||
textarea{
|
||||
float: right;
|
||||
display: block;
|
||||
padding:8px;
|
||||
width:100%;
|
||||
border-radius: 3px;
|
||||
border:2px solid rgba(203, 93, 93, 0.25);
|
||||
margin-top:3px;
|
||||
}
|
||||
.textarea1{
|
||||
resize:vertical;
|
||||
padding:8px;
|
||||
float: left;
|
||||
width:95%;
|
||||
border-radius: 3px;
|
||||
border:2px solid rgba(203, 93, 93, 0.25);
|
||||
margin-top:3px;
|
||||
margin-bottom:3px;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
select {
|
||||
float: left;
|
||||
display: block;
|
||||
padding:8px;
|
||||
width:30%;
|
||||
border-radius: 3px;
|
||||
border:2px solid rgba(203, 93, 93, 0.25);
|
||||
margin-top:3px;
|
||||
margin-left: 10px;
|
||||
margin-right: 10px;
|
||||
}
|
||||
.select1 {
|
||||
padding:8px;
|
||||
float: right;
|
||||
width:55%;
|
||||
border-radius: 3px;
|
||||
border:2px solid rgba(203, 93, 93, 0.25);
|
||||
margin-top:3px;
|
||||
margin-left: 10px;
|
||||
margin-right: 1px;
|
||||
}
|
||||
.select2 {
|
||||
padding:8px;
|
||||
float: left;
|
||||
width:75%;
|
||||
border-radius: 3px;
|
||||
border:2px solid rgba(203, 93, 93, 0.25);
|
||||
margin-top:3px;
|
||||
margin-left: 10px;
|
||||
margin-right: 1px;
|
||||
}
|
||||
|
||||
input[type='text']:hover,
|
||||
input[type='date']:hover,
|
||||
input[type='email']:hover,
|
||||
textarea:hover,
|
||||
select:hover {
|
||||
border: 2px solid rgba(203, 93, 93, 1);
|
||||
}
|
||||
|
||||
.btn{
|
||||
padding: 10px 25px;
|
||||
background:rgb(69, 204, 69);
|
||||
color:white;
|
||||
border: 2px solid rgb(69, 204, 69);
|
||||
border-radius: 5px;
|
||||
cursor: pointer;
|
||||
font-weight: 900;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
|
||||
.help-tip{
|
||||
top: 18px;
|
||||
right: 18px;
|
||||
text-align: center;
|
||||
background-color: #696fce;
|
||||
border-radius: 50%;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
font-size: 8px;
|
||||
line-height: 16px;
|
||||
cursor: default;
|
||||
margin: 5px;
|
||||
margin-top: 12px;
|
||||
}
|
||||
|
||||
.help-tip:before{
|
||||
content:'?';
|
||||
font-weight: bold;
|
||||
color:#fff;
|
||||
}
|
||||
.help-tip:hover{
|
||||
background-color: #6bb0db;
|
||||
}
|
||||
.help-tip:hover p{
|
||||
display:block;
|
||||
transform-origin: 100% 0%;
|
||||
-webkit-animation: fadeIn 0.3s ease-in-out;
|
||||
animation: fadeIn 0.3s ease-in-out;
|
||||
margin-top: 5px;
|
||||
background-color: #666c6e;
|
||||
}
|
||||
|
||||
.help-tip p{
|
||||
display: none;
|
||||
text-align: left;
|
||||
background-color: #1E2021;
|
||||
padding: 20px;
|
||||
width: 300px;
|
||||
position:relative;
|
||||
border-radius: 3px;
|
||||
box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.2);
|
||||
right: -4px;
|
||||
color: #FFF;
|
||||
font-size: 13px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.help-tip p:before{
|
||||
position: relative;
|
||||
content: '';
|
||||
width:0;
|
||||
height: 0;
|
||||
}
|
||||
|
||||
.help-tip p:after{
|
||||
width:100%;
|
||||
height:40px;
|
||||
content:'';
|
||||
position: relative;
|
||||
top:-40px;
|
||||
left:0;
|
||||
}
|
||||
|
||||
.line{
|
||||
width: 80%;
|
||||
float: left;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.lineleft{
|
||||
width: 13%;
|
||||
float: left;
|
||||
}
|
||||
.lineright{
|
||||
width: 87%;
|
||||
float: left;
|
||||
}
|
||||
|
||||
.line-help{
|
||||
width: 10%;
|
||||
float: left;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
.shortline{
|
||||
width: 60%;
|
||||
float: left;
|
||||
margin-top: 5px;
|
||||
margin-bottom: 5px;
|
||||
}
|
||||
|
||||
label{
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
color:black;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.labelhead{
|
||||
top: 50%;
|
||||
transform: translateY(50%);
|
||||
float: left;
|
||||
vertical-align: middle;
|
||||
color:black;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.labelService{
|
||||
float: left;
|
||||
vertical-align: middle;
|
||||
color:black;
|
||||
font-weight: 900;
|
||||
}
|
||||
|
||||
.hrline{
|
||||
width: 100%;
|
||||
height: 1px;
|
||||
background-color: #46449b;
|
||||
overflow: hidden;
|
||||
}
|
||||
.hrlineshort{
|
||||
width: 615px;
|
||||
height: 2px;
|
||||
background-color: #ffffff;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.hrlineService{
|
||||
float: left;
|
||||
width: 40%;
|
||||
height: 2px;
|
||||
margin-top: 10px;
|
||||
margin-bottom: 10px;
|
||||
background-color: #1b0772;
|
||||
overflow: hidden;
|
||||
}
|
||||
+2073
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,351 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>SFK测试</title>
|
||||
<link rel='stylesheet' href="../css/styles.css" />
|
||||
<script type="text/javascript" src="../fiseckey.js"></script>
|
||||
<script language="JavaScript">
|
||||
var dev = 0;
|
||||
var app = 0;
|
||||
var con = 0;
|
||||
var conname = 0;
|
||||
var flag = 0;
|
||||
|
||||
function PrintInfo(info) {
|
||||
deviceManagerText.value = deviceManagerText.value + info + "\r\n";
|
||||
document.getElementById("deviceManagerText").scrollTop = document.getElementById("deviceManagerText").scrollHeight;
|
||||
}
|
||||
function clearconsole() {
|
||||
deviceManagerText.value = "";
|
||||
document.getElementById("deviceManagerText").scrollTop = document.getElementById("deviceManagerText").scrollHeight;
|
||||
}
|
||||
|
||||
function seturl(dev,app,con,conname) {
|
||||
document.getElementById("indexhtml").href="../index.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("devhtml").href="./devicemanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("authhtml").href="./authmanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("apphtml").href="./appmanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("filehtml").href="./filemanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("containerhtml").href="./containermanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("servicehtml").href="./service.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
flag = 1;
|
||||
}
|
||||
|
||||
function decodeurl() {
|
||||
var url = window.location.href;
|
||||
var tmp = url.split('?');
|
||||
var param = tmp[1].split('&');
|
||||
dev = param[0].split('=')[1];
|
||||
app = param[1].split('=')[1];
|
||||
con = param[2].split('=')[1];
|
||||
conname = param[3].split('=')[1];
|
||||
}
|
||||
|
||||
window.onload=function() {
|
||||
if(flag != 1)
|
||||
decodeurl();
|
||||
seturl(dev,app,con,conname);
|
||||
}
|
||||
|
||||
function reload() {
|
||||
if(flag != 1)
|
||||
decodeurl();
|
||||
seturl(dev,app,con,conname);
|
||||
}
|
||||
|
||||
//function
|
||||
function ChangeDevAuthKey() {
|
||||
try {
|
||||
var authkey = appManage.authKey.value;
|
||||
var result = SKFKEY.SKF_ChangeDevAuthKey(dev, authkey);
|
||||
if(result == 0)
|
||||
PrintInfo("设置成功");
|
||||
else
|
||||
PrintInfo("设置失败,rev = " + result);
|
||||
}
|
||||
catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
//16进制转字符串
|
||||
function hexCharCodeToStr(hexCharCodeStr) {
|
||||
var trimedStr = hexCharCodeStr.trim();
|
||||
var rawStr =
|
||||
trimedStr.substr(0,2).toLowerCase() === "0x"
|
||||
?
|
||||
trimedStr.substr(2)
|
||||
:
|
||||
trimedStr;
|
||||
var len = rawStr.length;
|
||||
if(len % 2 !== 0) {
|
||||
alert("Illegal Format ASCII Code!");
|
||||
return "";
|
||||
}
|
||||
var curCharCode;
|
||||
var resultStr = [];
|
||||
for(var i = 0; i < len;i = i + 2) {
|
||||
curCharCode = parseInt(rawStr.substr(i, 2), 16); // ASCII Code Value
|
||||
resultStr.push(String.fromCharCode(curCharCode));
|
||||
}
|
||||
return resultStr.join("");
|
||||
}
|
||||
function DevAuth() {
|
||||
try {
|
||||
// var authData = appManage.authKey.value;
|
||||
var random = SKFKEY.SKF_GenRandom(dev,16);
|
||||
var hexran = hexCharCodeToStr(random);
|
||||
var ranarrbase64 = window.btoa(hexran);
|
||||
|
||||
var authkeybase64 = window.btoa("1234567812345678");
|
||||
var result = SKFKEY.SKF_SetSymmKey(dev, authkeybase64, 257);
|
||||
var sessionkey = result;
|
||||
var EncryptInitresult = SKFKEY.SKF_EncryptInit(sessionkey,0,0,0);
|
||||
var Encryptresult = SKFKEY.SKF_Encrypt(sessionkey,ranarrbase64);
|
||||
|
||||
var result = SKFKEY.SKF_DevAuth(dev, Encryptresult);
|
||||
if(result == 0)
|
||||
PrintInfo("验证成功");
|
||||
else
|
||||
PrintInfo("设置失败,rev = " + result);
|
||||
}
|
||||
catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function CreateApplication() {
|
||||
try {
|
||||
var appname = appManage.newappname.value;
|
||||
var adminpin = appManage.adminpin.value;
|
||||
var usrpin = appManage.usrpin.value;
|
||||
var retry = appManage.retrycount.value;
|
||||
var right = appManage.fileright.value;
|
||||
var result = SKFKEY.SKF_CreateApplication(dev, appname, adminpin, retry, usrpin, retry, right);
|
||||
app = result;
|
||||
seturl(dev,app,con,conname);
|
||||
PrintInfo("应用句柄:"+result);
|
||||
}
|
||||
catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function EnumApplication() {
|
||||
try {
|
||||
var result = SKFKEY.SKF_EnumApplication(dev);
|
||||
PrintInfo(result);
|
||||
}
|
||||
catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function DeleteApplication() {
|
||||
try {
|
||||
var appname = appManage.appname.value;
|
||||
var result = SKFKEY.SKF_DeleteApplication(dev, appname);
|
||||
app = 0;
|
||||
seturl(dev,app,con,conname);
|
||||
if(result == 0)
|
||||
PrintInfo("删除成功");
|
||||
else
|
||||
PrintInfo("删除失败,rev="+result);
|
||||
}
|
||||
catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function OpenApplication() {
|
||||
try {
|
||||
var appname = appManage.appname.value;
|
||||
var result = SKFKEY.SKF_OpenApplication(dev, appname);
|
||||
app = result;
|
||||
seturl(dev,app,con,conname);
|
||||
PrintInfo(result);
|
||||
}
|
||||
catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function CloseApplication() {
|
||||
try {
|
||||
var result = SKFKEY.SKF_CloseApplication(app);
|
||||
if(result == 0)
|
||||
PrintInfo("关闭成功");
|
||||
else
|
||||
PrintInfo("关闭失败,rev="+result);
|
||||
}
|
||||
catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div="root">
|
||||
<header>
|
||||
<div>
|
||||
<h1 class="title">
|
||||
SKF FisecKey demo
|
||||
</h1>
|
||||
<ul class="menu">
|
||||
<li>
|
||||
<a id = indexhtml onclick="reload()" href="../index.html?dev=0&app=0&con=0&conname=0">简介</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = devhtml onclick="reload()" href="./devicemanager.html?dev=0&app=0&con=0&conname=0">设备管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = apphtml onclick="reload()" href="./appmanager.html?dev=0&app=0&con=0&conname=0" class='active'>应用管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = authhtml onclick="reload()" href="./authmanager.html?dev=0&app=0&con=0&conname=0">访问控制</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = filehtml onclick="reload()" href="./filemanager.html?dev=0&app=0&con=0&conname=0">文件管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = containerhtml onclick="reload()" href="./containermanager.html?dev=0&app=0&con=0&conname=0">容器管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = servicehtml onclick="reload()" href="./service.html?dev=0&app=0&con=0&conname=0">密码服务</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
<div class = "form1">
|
||||
<form name = "appManage">
|
||||
<div class="form-group">
|
||||
<!-- <div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="authKey">认证参数</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<input type="text" id="authKey"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line-help">
|
||||
<div class="help-tip">
|
||||
<p>
|
||||
认证参数:当修改设备认证密钥时,此框输入设备认证密钥。当进行设备认证时,此框输入认证数据
|
||||
</p>
|
||||
</div>
|
||||
</div>-->
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead">认证设备</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
||
|
||||
<input class="btn" type="button" value="设备认证" onclick="DevAuth()"/>
|
||||
</div>
|
||||
<!-- <input class="btn" type="button" value="修改设备认证密钥" onclick="ChangeDevAuthKey()" />-->
|
||||
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="appname">应用名</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<input type="text" id="appname" value="name"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line-help">
|
||||
<div class="help-tip">
|
||||
<p>
|
||||
应用名称:需要枚举或输入要管理的应用名
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<input class="btn" type="button" value="枚举应用" onclick="EnumApplication()" />
|
||||
||
|
||||
<input class="btn" type="button" value="打开应用" onclick="OpenApplication()" />
|
||||
<input class="btn" type="button" value="关闭应用" onclick="CloseApplication()" />
|
||||
||
|
||||
<input class="btn" type="button" value="删除应用" onclick="DeleteApplication()" />
|
||||
</div>
|
||||
<div class="line"><div class="hrline"></div></div>
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="newappname">新应用名</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<input type="text" id="newappname"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line-help">
|
||||
<div class="help-tip">
|
||||
<p>
|
||||
应用名称:需要创建或删除的应用名称
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="usrpin">用户Pin码</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<input type="text" id="usrpin"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="adminpin">管理Pin码</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<input type="text" id="adminpin"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="retrycount">重试次数</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<input type="text" id="retrycount"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line-help">
|
||||
<div class="help-tip">
|
||||
<p>
|
||||
重试次数:Pin码最大重试次数
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label>文件及容器权限</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<input type="radio" id='rightnone' value='0' name = "fileright">
|
||||
<label for="rightnone">禁止访问</label>
|
||||
<input type="radio" id='rightuser' value='16' name = "fileright">
|
||||
<label for="rightuser">操作员</label>
|
||||
<input type="radio" id='rightadmin' value='1' name = "fileright">
|
||||
<label for="rightadmin">管理员</label>
|
||||
<input type="radio" id='righteveryone' value='255' name = "fileright">
|
||||
<label for="righteveryone">所有人</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<input class="btn" type="button" value="创建应用" onclick="CreateApplication()" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<input type="button" class="footclear" value="清空" onclick="clearconsole()" />
|
||||
<textarea readonly class="footconsole" id="deviceManagerText" rows="8"></textarea>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,240 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>SFK测试</title>
|
||||
<link rel='stylesheet' href="../css/styles.css" />
|
||||
<script type="text/javascript" src="../fiseckey.js"></script>
|
||||
<script language="JavaScript">
|
||||
var dev = 0;
|
||||
var app = 0;
|
||||
var con = 0;
|
||||
var conname = 0;
|
||||
var flag = 0;
|
||||
|
||||
function PrintInfo(info) {
|
||||
deviceManagerText.value = deviceManagerText.value + info + "\r\n";
|
||||
document.getElementById("deviceManagerText").scrollTop = document.getElementById("deviceManagerText").scrollHeight;
|
||||
}
|
||||
function clearconsole() {
|
||||
deviceManagerText.value = "";
|
||||
document.getElementById("deviceManagerText").scrollTop = document.getElementById("deviceManagerText").scrollHeight;
|
||||
}
|
||||
|
||||
function seturl(dev,app,con,conname) {
|
||||
document.getElementById("indexhtml").href="../index.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("devhtml").href="./devicemanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("authhtml").href="./authmanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("apphtml").href="./appmanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("filehtml").href="./filemanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("containerhtml").href="./containermanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("servicehtml").href="./service.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
flag = 1;
|
||||
}
|
||||
|
||||
function decodeurl() {
|
||||
var url = window.location.href;
|
||||
var tmp = url.split('?');
|
||||
var param = tmp[1].split('&');
|
||||
dev = param[0].split('=')[1];
|
||||
app = param[1].split('=')[1];
|
||||
con = param[2].split('=')[1];
|
||||
conname = param[3].split('=')[1];
|
||||
}
|
||||
|
||||
window.onload=function() {
|
||||
if(flag != 1)
|
||||
decodeurl();
|
||||
seturl(dev,app,con,conname);
|
||||
}
|
||||
|
||||
function reload() {
|
||||
if(flag != 1)
|
||||
decodeurl();
|
||||
seturl(dev,app,con,conname);
|
||||
}
|
||||
|
||||
//function
|
||||
function ChangePIN() {
|
||||
try{
|
||||
var pintype = authManage.pintype1.value;
|
||||
var oldpin = authManage.oldpin.value;
|
||||
var newpin = authManage.newpin.value;
|
||||
var newpin1 = authManage.newpin1.value;
|
||||
if(newpin != newpin1){
|
||||
alert("两次输入的PIN码不一致")
|
||||
return;
|
||||
}
|
||||
var result = SKFKEY.SKF_ChangePIN(app, pintype, oldpin, newpin);
|
||||
if(result == 0)
|
||||
PrintInfo("修改成功");
|
||||
}catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function GetPINInfo() {
|
||||
try{
|
||||
var pintype = authManage.pintype.value;
|
||||
var result = SKFKEY.SKF_GetPINInfo(app, pintype);
|
||||
PrintInfo(JSON.stringify(result));
|
||||
}catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function VerifyPIN() {
|
||||
try{
|
||||
var pintype = authManage.pintype.value;
|
||||
var pin = authManage.verifypin.value;
|
||||
var result = SKFKEY.SKF_VerifyPIN(app, pintype, pin);
|
||||
if(result == 0)
|
||||
PrintInfo("校验成功");
|
||||
}catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function UnblockPIN() {
|
||||
try{
|
||||
var pintype = authManage.pintype1.value;
|
||||
var adminpin = authManage.oldpin.value;
|
||||
var usrpin = authManage.newpin.value;
|
||||
var newpin1 = authManage.newpin1.value;
|
||||
if(usrpin != newpin1){
|
||||
alert("两次输入的PIN码不一致")
|
||||
return;
|
||||
}
|
||||
var result = SKFKEY.SKF_UnblockPIN(app, adminpin, usrpin);
|
||||
if(result == 0)
|
||||
PrintInfo("解锁成功");
|
||||
}catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function ClearSecureState() {
|
||||
try{
|
||||
var result = SKFKEY.SKF_ClearSecureState(app);
|
||||
if(result == 0)
|
||||
PrintInfo("清除成功");
|
||||
}catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div="root">
|
||||
<header>
|
||||
<div>
|
||||
<h1 class="title">
|
||||
SKF FisecKey demo
|
||||
</h1>
|
||||
<ul class="menu">
|
||||
<li>
|
||||
<a id = indexhtml onclick="reload()" href="../index.html?dev=0&app=0&con=0&conname=0">简介</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = devhtml onclick="reload()" href="./devicemanager.html?dev=0&app=0&con=0&conname=0">设备管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = apphtml onclick="reload()" href="./appmanager.html?dev=0&app=0&con=0&conname=0">应用管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = authhtml onclick="reload()" href="./authmanager.html?dev=0&app=0&con=0&conname=0" class='active'>访问控制</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = filehtml onclick="reload()" href="./filemanager.html?dev=0&app=0&con=0&conname=0">文件管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = containerhtml onclick="reload()" href="./containermanager.html?dev=0&app=0&con=0&conname=0">容器管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = servicehtml onclick="reload()" href="./service.html?dev=0&app=0&con=0&conname=0">密码服务</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
<div class = "form1">
|
||||
<form name = "authManage">
|
||||
<div class="form-group">
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="verifypin">PIN</label>
|
||||
<select class="select1" name="pintypeName" id="pintype">
|
||||
<option value="1">操作员</option>
|
||||
<option value="0">管理员</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<input type="password" id="verifypin" value="12345678"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<input class="btn" type="button" value="获取PIN码信息" onclick="GetPINInfo()" />
|
||||
<input class="btn" type="button" value="校验PIN码" onclick="VerifyPIN()" />
|
||||
||
|
||||
<input class="btn" type="button" value="清除应用安全状态" onclick="ClearSecureState()" />
|
||||
</div>
|
||||
<div class="line"><div class="hrline"></div></div>
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="oldpin">用户类型</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<select class="select" name="pintypeName1" id="pintype1">
|
||||
<option value="1">操作员</option>
|
||||
<option value="0">管理员</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="oldpin">旧/管理员PIN码</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<input type="password" id="oldpin"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line-help">
|
||||
<div class="help-tip">
|
||||
<p>
|
||||
当为修改PIN码时,此框传入旧的PIN码。当为解锁PIN码时,此框传入管理员PIN码
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="newpin">新PIN码</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<input type="password" id="newpin"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="newpin1">确认新PIN码</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<input type="password" id="newpin1"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<input class="btn" type="button" value="修改PIN码" onclick="ChangePIN()" />
|
||||
<input class="btn" type="button" value="解锁PIN码" onclick="UnblockPIN()" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<input type="button" class="footclear" value="清空" onclick="clearconsole()" />
|
||||
<textarea class="footconsole" id="deviceManagerText" rows="8"></textarea>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,247 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>SFK测试</title>
|
||||
<link rel='stylesheet' href="../css/styles.css" />
|
||||
<script type="text/javascript" src="../fiseckey.js"></script>
|
||||
<script language="JavaScript">
|
||||
var dev = 0;
|
||||
var app = 0;
|
||||
var con = 0;
|
||||
var conname = 0;
|
||||
var flag = 0;
|
||||
|
||||
function PrintInfo(info) {
|
||||
deviceManagerText.value = deviceManagerText.value + info + "\r\n";
|
||||
document.getElementById("deviceManagerText").scrollTop = document.getElementById("deviceManagerText").scrollHeight;
|
||||
}
|
||||
function clearconsole() {
|
||||
deviceManagerText.value = "";
|
||||
document.getElementById("deviceManagerText").scrollTop = document.getElementById("deviceManagerText").scrollHeight;
|
||||
}
|
||||
|
||||
function seturl(dev,app,con,conname) {
|
||||
document.getElementById("indexhtml").href="../index.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("devhtml").href="./devicemanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("authhtml").href="./authmanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("apphtml").href="./appmanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("filehtml").href="./filemanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("containerhtml").href="./containermanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("servicehtml").href="./service.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
flag = 1;
|
||||
}
|
||||
|
||||
function decodeurl() {
|
||||
var url = window.location.href;
|
||||
var tmp = url.split('?');
|
||||
var param = tmp[1].split('&');
|
||||
dev = param[0].split('=')[1];
|
||||
app = param[1].split('=')[1];
|
||||
con = param[2].split('=')[1];
|
||||
conname = param[3].split('=')[1];
|
||||
}
|
||||
|
||||
window.onload=function() {
|
||||
if(flag != 1)
|
||||
decodeurl();
|
||||
seturl(dev,app,con,conname);
|
||||
}
|
||||
|
||||
function reload() {
|
||||
if(flag != 1)
|
||||
decodeurl();
|
||||
seturl(dev,app,con,conname);
|
||||
}
|
||||
|
||||
//function
|
||||
function EnumContainer() {
|
||||
try {
|
||||
var result = SKFKEY.SKF_EnumContainer(app);
|
||||
PrintInfo(result);
|
||||
} catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function GetContainerType() {
|
||||
try {
|
||||
var result = SKFKEY.SKF_GetContainerType(con);
|
||||
PrintInfo(result);
|
||||
} catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function CreateContainer() {
|
||||
try {
|
||||
var cname = containerManager.containername.value;
|
||||
var result = SKFKEY.SKF_CreateContainer(app, cname);
|
||||
con = result;
|
||||
conname = cname;
|
||||
seturl(dev,app,con,conname);
|
||||
PrintInfo("容器句柄:" + result);
|
||||
} catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function DeleteContainer() {
|
||||
try {
|
||||
var cname = containerManager.containername.value;
|
||||
var result = SKFKEY.SKF_DeleteContainer(app, cname);
|
||||
if(result == 0)
|
||||
PrintInfo("删除成功");
|
||||
} catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function OpenContainer() {
|
||||
try {
|
||||
var cname = containerManager.containername.value;
|
||||
var result = SKFKEY.SKF_OpenContainer(app, cname);
|
||||
con = result;
|
||||
conname = cname;
|
||||
seturl(dev,app,con,conname);
|
||||
PrintInfo("容器句柄:" + result);
|
||||
} catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function CloseContainer() {
|
||||
try {
|
||||
var result = SKFKEY.SKF_CloseContainer(con);
|
||||
if(result == 0)
|
||||
PrintInfo("关闭成功");
|
||||
con = 0;
|
||||
conname = 0;
|
||||
seturl(dev,app,con,conname);
|
||||
} catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function ImportCertificate() {
|
||||
try {
|
||||
var flag = containerManager.certType.value;
|
||||
var cert = containerManager.certData.value;
|
||||
var result = SKFKEY.SKF_ImportCertificate(con, flag, cert);
|
||||
if(result == 0)
|
||||
PrintInfo("导入成功");
|
||||
} catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function ExportCertificate() {
|
||||
try {
|
||||
var flag = containerManager.certType.value;
|
||||
var result = SKFKEY.SKF_ExportCertificate(con, flag);
|
||||
PrintInfo(result);
|
||||
} catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div="root">
|
||||
<header>
|
||||
<div>
|
||||
<h1 class="title">
|
||||
SKF FisecKey demo
|
||||
</h1>
|
||||
<ul class="menu">
|
||||
<li>
|
||||
<a id = indexhtml onclick="reload()" href="../index.html?dev=0&app=0&con=0&conname=0">简介</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = devhtml onclick="reload()" href="./devicemanager.html?dev=0&app=0&con=0&conname=0">设备管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = apphtml onclick="reload()" href="./appmanager.html?dev=0&app=0&con=0&conname=0">应用管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = authhtml onclick="reload()" href="./authmanager.html?dev=0&app=0&con=0&conname=0">访问控制</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = filehtml onclick="reload()" href="./filemanager.html?dev=0&app=0&con=0&conname=0">文件管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = containerhtml onclick="reload()" href="./containermanager.html?dev=0&app=0&con=0&conname=0" class='active'>容器管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = servicehtml onclick="reload()" href="./service.html?dev=0&app=0&con=0&conname=0">密码服务</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
<div class = "form1">
|
||||
<form name = "containerManager">
|
||||
<div class="form-group">
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="containername">容器名称</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<input type="text" id="containername"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<input class="btn" type="button" value="枚举容器" onclick="EnumContainer()" />
|
||||
||
|
||||
<input class="btn" type="button" value="创建容器" onclick="CreateContainer()" />
|
||||
<input class="btn" type="button" value="删除容器" onclick="DeleteContainer()" />
|
||||
||
|
||||
<input class="btn" type="button" value="打开容器" onclick="OpenContainer()" />
|
||||
<input class="btn" type="button" value="关闭容器" onclick="CloseContainer()" />
|
||||
<input class="btn" type="button" value="获取容器类型" onclick="GetContainerType()" />
|
||||
</div>
|
||||
<div class="line"><div class="hrline"></div></div>
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="certType">证书类型</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<select class="select" name="certTypeName" id="certType">
|
||||
<option value="1">签名证书</option>
|
||||
<option value="0">加密证书</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="certData">证书数据</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<textarea class="textarea1" id="certData" cols="30" rows="10"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line-help">
|
||||
<div class="help-tip">
|
||||
<p>
|
||||
输入的证书数据是PEM结构
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<input class="btn" type="button" value="导入证书" onclick="ImportCertificate()" />
|
||||
<input class="btn" type="button" value="导出证书" onclick="ExportCertificate()" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<input type="button" class="footclear" value="清空" onclick="clearconsole()" />
|
||||
<textarea class="footconsole" id="deviceManagerText" rows="8"></textarea>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,270 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>SFK测试</title>
|
||||
<link rel='stylesheet' href="../css/styles.css" />
|
||||
<script type="text/javascript" src="../fiseckey.js"></script>
|
||||
<script language="JavaScript">
|
||||
var dev = 0;
|
||||
var app = 0;
|
||||
var con = 0;
|
||||
var conname = 0;
|
||||
var flag = 0;
|
||||
|
||||
function PrintInfo(info) {
|
||||
deviceManagerText.value = deviceManagerText.value + info + "\r\n";
|
||||
document.getElementById("deviceManagerText").scrollTop = document.getElementById("deviceManagerText").scrollHeight;
|
||||
}
|
||||
function clearconsole() {
|
||||
deviceManagerText.value = "";
|
||||
document.getElementById("deviceManagerText").scrollTop = document.getElementById("deviceManagerText").scrollHeight;
|
||||
}
|
||||
|
||||
function seturl(dev,app,con,conname) {
|
||||
document.getElementById("indexhtml").href="../index.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("devhtml").href="./devicemanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("authhtml").href="./authmanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("apphtml").href="./appmanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("filehtml").href="./filemanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("containerhtml").href="./containermanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("servicehtml").href="./service.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
flag = 1;
|
||||
}
|
||||
|
||||
function decodeurl() {
|
||||
var url = window.location.href;
|
||||
var tmp = url.split('?');
|
||||
var param = tmp[1].split('&');
|
||||
dev = param[0].split('=')[1];
|
||||
app = param[1].split('=')[1];
|
||||
con = param[2].split('=')[1];
|
||||
conname = param[3].split('=')[1];
|
||||
}
|
||||
|
||||
window.onload=function() {
|
||||
if(flag != 1)
|
||||
decodeurl();
|
||||
seturl(dev,app,con,conname);
|
||||
}
|
||||
|
||||
function reload() {
|
||||
if(flag != 1)
|
||||
decodeurl();
|
||||
seturl(dev,app,con,conname);
|
||||
}
|
||||
|
||||
//function
|
||||
function EnumDevice(provider) {
|
||||
try {
|
||||
var keytype = devManage.deviceType.value;
|
||||
var result = SKFKEY.SKF_EnumDev(1, keytype);
|
||||
PrintInfo(result);
|
||||
}
|
||||
catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function ConnectDev() {
|
||||
try {
|
||||
var prov = devManage.deviceType.value;
|
||||
var seriel = devManage.deviceSeriel.value;
|
||||
var result = SKFKEY.SKF_ConnectDev(seriel,prov);
|
||||
dev = result;
|
||||
seturl(dev,app,con,conname);
|
||||
PrintInfo("打开设备成功,设备句柄:"+result);
|
||||
}
|
||||
catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function DisconnectDev() {
|
||||
try {
|
||||
var result = SKFKEY.SKF_DisConnect(dev);
|
||||
if(result == 0)
|
||||
PrintInfo("关闭设备成功");
|
||||
else
|
||||
PrintInfo("关闭设备失败,rev = " + result);
|
||||
}
|
||||
catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function GetDevState() {
|
||||
try {
|
||||
var prov = devManage.deviceType.value;
|
||||
var seriel = devManage.deviceSeriel.value;
|
||||
var result = SKFKEY.SKF_GetDevState(seriel,prov);
|
||||
PrintInfo("设备状态:"+result);
|
||||
}
|
||||
catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function SetLabel() {
|
||||
try {
|
||||
var name = devManage.deviceLabel.value;
|
||||
var result = SKFKEY.SKF_SetLabel(dev,name);
|
||||
if(result == 0)
|
||||
PrintInfo("设置成功");
|
||||
else
|
||||
PrintInfo("设置失败,rev = " + result);
|
||||
}
|
||||
catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function GetDevInfo() {
|
||||
try {
|
||||
var result = SKFKEY.SKF_GetDevInfo(dev);
|
||||
PrintInfo(JSON.stringify(result));
|
||||
}
|
||||
catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function LockDev() {
|
||||
try {
|
||||
var result = SKFKEY.SKF_LockDev(dev,5);
|
||||
if(result == 0)
|
||||
PrintInfo("锁定成功");
|
||||
else
|
||||
PrintInfo("锁定失败,rev = " + result);
|
||||
}
|
||||
catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function UnlockDev() {
|
||||
try {
|
||||
var result = SKFKEY.SKF_UnlockDev(dev);
|
||||
if(result == 0)
|
||||
PrintInfo("解锁成功");
|
||||
else
|
||||
PrintInfo("解锁失败,rev = " + result);
|
||||
}
|
||||
catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div="root">
|
||||
<header>
|
||||
<div>
|
||||
<h1 class="title">
|
||||
SKF FisecKey demo
|
||||
</h1>
|
||||
<ul class="menu">
|
||||
<li>
|
||||
<a id = indexhtml onclick="reload()" href="../index.html?dev=0&app=0&con=0&conname=0">简介</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = devhtml onclick="reload()" href="./devicemanager.html?dev=0&app=0&con=0&conname=0" class='active'>设备管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = apphtml onclick="reload()" href="./appmanager.html?dev=0&app=0&con=0&conname=0">应用管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = authhtml onclick="reload()" href="./authmanager.html?dev=0&app=0&con=0&conname=0">访问控制</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = filehtml onclick="reload()" href="./filemanager.html?dev=0&app=0&con=0&conname=0">文件管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = containerhtml onclick="reload()" href="./containermanager.html?dev=0&app=0&con=0&conname=0">容器管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = servicehtml onclick="reload()" href="./service.html?dev=0&app=0&con=0&conname=0">密码服务</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
<div class="form1">
|
||||
<form name = "devManage">
|
||||
<div class="form-group">
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="deviceType">设备类型</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<input type="text" id="deviceType"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line-help">
|
||||
<div class="help-tip">
|
||||
<p>
|
||||
设备类型:根据不同厂商的key填入不同的厂商缩写或缩写前的序号。厂商的序号可以在配置文件里修改。
|
||||
目前支持渔翁、龙脉、海泰、飞天、国新key。置空则枚举全部厂商设备
|
||||
<br>1:F-OLD、2:F-ST、3:F-3310、4:LM、5:HT、6:FT、7:GX、
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="deviceSeriel">设备序列号</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<input type="text" id="deviceSeriel" placeholder="XXXXXXXXXXXXXXXX" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="line-help">
|
||||
<div class="help-tip">
|
||||
<p>
|
||||
设备序列号:通过枚举设备获得的设备的标识,相同序列号取第一个。
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<input class="btn" type="button" value="枚举设备" onclick="EnumDevice()" />
|
||||
||
|
||||
<input class="btn" type="button" value="连接设备" onclick="ConnectDev()" />
|
||||
<input class="btn" type="button" value="断开设备" onclick="DisconnectDev()" />
|
||||
</div>
|
||||
<div class="line"><div class="hrline"></div></div>
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="deviceLabel">设备标签</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<input type="text" id="deviceLabel" placeholder="Name" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="line-help">
|
||||
<div class="help-tip">
|
||||
<p>
|
||||
设备标签:设备别名,总长度需要小于32字节,中文不超过10个。
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<input class="btn" type="button" value="获取设备状态" onclick="GetDevState()" />
|
||||
<input class="btn" type="button" value="获取设备信息" onclick="GetDevInfo()" />
|
||||
||
|
||||
<input class="btn" type="button" value="设置设备标签" onclick="SetLabel()" />
|
||||
||
|
||||
<input class="btn" type="button" value="锁定设备" onclick="LockDev()" />
|
||||
<input class="btn" type="button" value="解锁设备" onclick="UnlockDev()" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<input type="button" class="footclear" value="清空" onclick="clearconsole()" />
|
||||
<textarea readonly class="footconsole" id="deviceManagerText" rows="8"></textarea>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
@@ -0,0 +1,397 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>SFK测试</title>
|
||||
<link rel='stylesheet' href="../css/styles.css" />
|
||||
<script type="text/javascript" src="../fiseckey.js"></script>
|
||||
<script language="JavaScript">
|
||||
var dev = 0;
|
||||
var app = 0;
|
||||
var con = 0;
|
||||
var conname = 0;
|
||||
var flag = 0;
|
||||
|
||||
function PrintInfo(info) {
|
||||
deviceManagerText.value = deviceManagerText.value + info + "\r\n";
|
||||
document.getElementById("deviceManagerText").scrollTop = document.getElementById("deviceManagerText").scrollHeight;
|
||||
}
|
||||
function clearconsole() {
|
||||
deviceManagerText.value = "";
|
||||
document.getElementById("deviceManagerText").scrollTop = document.getElementById("deviceManagerText").scrollHeight;
|
||||
}
|
||||
|
||||
function seturl(dev,app,con,conname) {
|
||||
document.getElementById("indexhtml").href="../index.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("devhtml").href="./devicemanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("authhtml").href="./authmanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("apphtml").href="./appmanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("filehtml").href="./filemanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("containerhtml").href="./containermanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("servicehtml").href="./service.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
flag = 1;
|
||||
}
|
||||
|
||||
function decodeurl() {
|
||||
var url = window.location.href;
|
||||
var tmp = url.split('?');
|
||||
var param = tmp[1].split('&');
|
||||
dev = param[0].split('=')[1];
|
||||
app = param[1].split('=')[1];
|
||||
con = param[2].split('=')[1];
|
||||
conname = param[3].split('=')[1];
|
||||
}
|
||||
|
||||
window.onload=function() {
|
||||
if(flag != 1)
|
||||
decodeurl();
|
||||
seturl(dev,app,con,conname);
|
||||
}
|
||||
|
||||
function reload() {
|
||||
if(flag != 1)
|
||||
decodeurl();
|
||||
seturl(dev,app,con,conname);
|
||||
}
|
||||
//function
|
||||
function CreateFile() {
|
||||
try {
|
||||
var filename = authManage.filename.value;
|
||||
var filesize = authManage.filesize.value;
|
||||
var readright = authManage.readright.value;
|
||||
var writeright = authManage.writeright.value;
|
||||
var result = SKFKEY.SKF_CreateFile(app, filename, filesize, 16, 16);
|
||||
if(result == 0)
|
||||
PrintInfo("创建成功");
|
||||
} catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function DeleteFile() {
|
||||
try {
|
||||
var filename = authManage.filename.value;
|
||||
var result = SKFKEY.SKF_DeleteFile(app, filename);
|
||||
if(result == 0)
|
||||
PrintInfo("删除成功");
|
||||
} catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function EnumFiles() {
|
||||
try {
|
||||
var result = SKFKEY.SKF_EnumFiles(app);
|
||||
PrintInfo(result);
|
||||
} catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function GetFileInfo() {
|
||||
try {
|
||||
var filename = authManage.filename.value;
|
||||
var result = SKFKEY.SKF_GetFileInfo(app, filename);
|
||||
PrintInfo(JSON.stringify(result));
|
||||
} catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function ReadFile() {
|
||||
try {
|
||||
var filename = authManage.filename1.value;
|
||||
var offset = parseInt(authManage.rwoffset.value);
|
||||
//var datalen = parseInt(authManage.dataLen.value);
|
||||
var len = SKFKEY.SKF_ReadFile(app, filename, 0, 3);
|
||||
len = parseInt( len, 10 );
|
||||
var result = SKFKEY.SKF_ReadFile(app, filename, 3, len)
|
||||
|
||||
PrintInfo("文件数据:" + result);
|
||||
console.log(hexToObject(result))
|
||||
} catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function ReadFile1() {
|
||||
try {
|
||||
var filename = authManage.filename1.value;
|
||||
var offset = parseInt(authManage.rwoffset.value);
|
||||
var datalen = parseInt(authManage.dataLen.value);
|
||||
var result = SKFKEY.SKF_ReadFile(app, filename, offset, datalen);
|
||||
PrintInfo("文件数据:" + result);
|
||||
console.log(hexToObject(result))
|
||||
} catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
// 将 HEX 字符串转换为对象
|
||||
function hexToObject(hexString) {
|
||||
|
||||
// 去除填充的 F 字符,寻找有效的 JSON 数据
|
||||
let str = hexString.replace(/F+$/, ''); // 去除字符串末尾的 F 字符
|
||||
|
||||
// 每两位HEX字符转换成一个字符
|
||||
let jsonString = ''
|
||||
for (let i = 0; i < str.length; i += 2) {
|
||||
jsonString += String.fromCharCode(parseInt(str.substr(i, 2), 16))
|
||||
}
|
||||
console.log('解析 JSON 数据', jsonString);
|
||||
// 尝试解析 JSON 数据
|
||||
try {
|
||||
return JSON.parse(jsonString); // 返回解析后的 JSON 对象
|
||||
} catch (e) {
|
||||
return { error: "无法解析 JSON", rawString: jsonString }; // 返回解析失败的错误信息
|
||||
}
|
||||
// 将 JSON 字符串解析为对象
|
||||
// return JSON.parse(jsonString);
|
||||
}
|
||||
|
||||
function WriteFile() {
|
||||
try {
|
||||
var filename = authManage.filename1.value;
|
||||
var offset = parseInt(authManage.rwoffset.value);
|
||||
var data = authManage.writedata.value;
|
||||
var datalen = parseInt(authManage.dataLen.value);
|
||||
|
||||
var len = '000000' + datalen
|
||||
len = len.substr(len.length - 6)
|
||||
|
||||
writeData(app, filename, 0, datalen + 3, len+data)
|
||||
PrintInfo("写入成功");
|
||||
} catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
function WriteFile1() {
|
||||
try {
|
||||
var filename = authManage.filename1.value;
|
||||
var offset = parseInt(authManage.rwoffset.value);
|
||||
var data = authManage.writedata.value;
|
||||
var datalen = parseInt(authManage.dataLen.value);
|
||||
|
||||
var result = SKFKEY.SKF_WriteFile(app, filename, offset, datalen, data);
|
||||
if(result == 0)
|
||||
PrintInfo("写入成功");
|
||||
} catch (e) {
|
||||
PrintInfo(e.message);
|
||||
}
|
||||
}
|
||||
|
||||
function writeData(app, filename, offset, datalen, data) {
|
||||
if (datalen <= 1000) {
|
||||
SKFKEY.SKF_WriteFile(app, filename, offset, datalen, data);
|
||||
} else {
|
||||
// 先写入 1000
|
||||
SKFKEY.SKF_WriteFile(app, filename, offset, 1000, data.substr(0, 2000));
|
||||
writeData(app, filename, offset + 1000, datalen - 1000, data.substr(2000))
|
||||
}
|
||||
}
|
||||
|
||||
// function writeData(app, filename, offset, datalen, data) {
|
||||
// const CHUNK_SIZE = 1000; // 每次固定写 1000 字节
|
||||
// const HEX_CHUNK = CHUNK_SIZE * 2; // 2000 个 HEX 字符
|
||||
|
||||
// let currentOffset = offset;
|
||||
// let remainingData = data;
|
||||
// let isFirst = true;
|
||||
|
||||
// while (remainingData.length > 0) {
|
||||
// let chunkHex;
|
||||
|
||||
// // ====================== 核心逻辑 ======================
|
||||
// if (isFirst) {
|
||||
// // 第一次:直接取前 2000 个字符
|
||||
// chunkHex = remainingData.substring(0, HEX_CHUNK);
|
||||
// isFirst = false;
|
||||
// } else {
|
||||
// // 第2、3、4次:前面补 2000 个 0 + 取后面 2000 个字符
|
||||
// const realData = remainingData.substring(0, HEX_CHUNK);
|
||||
// chunkHex = '0'.repeat(HEX_CHUNK) + realData;
|
||||
// }
|
||||
|
||||
// // 实际长度
|
||||
// const chunkSize = chunkHex.length / 2;
|
||||
|
||||
// // 调用写入
|
||||
// SKFKEY.SKF_WriteFile(app, filename, currentOffset, chunkSize, chunkHex);
|
||||
|
||||
// // 偏移 + 剩余数据截断
|
||||
// currentOffset += CHUNK_SIZE;
|
||||
// remainingData = remainingData.substring(HEX_CHUNK);
|
||||
// }
|
||||
// }
|
||||
function readData(app, filename, offset, datalen) {
|
||||
// 最终结果
|
||||
let result = '';
|
||||
// 每次最大读取长度
|
||||
const MAX_READ = 1000;
|
||||
|
||||
// 循环分段读取(比递归更安全、更易读)
|
||||
while (datalen > 0) {
|
||||
// 本次读取长度:取 2000 和剩余长度的较小值
|
||||
const readLen = Math.min(MAX_READ, datalen);
|
||||
|
||||
// 读取一段数据
|
||||
const chunk = SKFKEY.SKF_ReadFile(app, filename, offset, readLen);
|
||||
|
||||
// 拼接到结果
|
||||
result += chunk;
|
||||
|
||||
// 偏移量前进
|
||||
offset += readLen;
|
||||
// 剩余长度减少
|
||||
datalen -= readLen;
|
||||
}
|
||||
|
||||
// 最终返回完整数据
|
||||
return result;
|
||||
}
|
||||
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
<div="root">
|
||||
<header>
|
||||
<div>
|
||||
<h1 class="title">
|
||||
SKF FisecKey demo
|
||||
</h1>
|
||||
<ul class="menu">
|
||||
<li>
|
||||
<a id = indexhtml onclick="reload()" href="../index.html?dev=0&app=0&con=0&conname=0">简介</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = devhtml onclick="reload()" href="./devicemanager.html?dev=0&app=0&con=0&conname=0">设备管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = apphtml onclick="reload()" href="./appmanager.html?dev=0&app=0&con=0&conname=0">应用管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = authhtml onclick="reload()" href="./authmanager.html?dev=0&app=0&con=0&conname=0">访问控制</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = filehtml onclick="reload()" href="./filemanager.html?dev=0&app=0&con=0&conname=0" class='active'>文件管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = containerhtml onclick="reload()" href="./containermanager.html?dev=0&app=0&con=0&conname=0">容器管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = servicehtml onclick="reload()" href="./service.html?dev=0&app=0&con=0&conname=0">密码服务</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
<div class = "form1">
|
||||
<form name = "authManage">
|
||||
<div class="form-group">
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="filename">文件名称</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<input type="text" id="filename"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="filesize">文件大小</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<input type="text" id="filesize"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="readright">读权限</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<select class="select" name="readrightName" id="readright">
|
||||
<option value="16">操作员</option>
|
||||
<option value="1">管理员</option>
|
||||
<option value="255">所有人</option>
|
||||
<option value="0">禁止访问</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="writeright">写权限</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<select class="select" name="writerightName" id="writeright">
|
||||
<option value="16">操作员</option>
|
||||
<option value="1">管理员</option>
|
||||
<option value="255">所有人</option>
|
||||
<option value="0">禁止访问</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<input class="btn" type="button" value="枚举文件" onclick="EnumFiles()" />
|
||||
<input class="btn" type="button" value="获取文件信息" onclick="GetFileInfo()" />
|
||||
||
|
||||
<input class="btn" type="button" value="创建文件" onclick="CreateFile()" />
|
||||
<input class="btn" type="button" value="删除文件" onclick="DeleteFile()" />
|
||||
</div>
|
||||
<div class="line"><div class="hrline"></div></div>
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="filename1">文件名称</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<input type="text" id="filename1" value="lmk"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="writedata">写入数据</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<textarea class="textarea1" id="writedata" cols="30" rows="2"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line-help">
|
||||
<div class="help-tip">
|
||||
<p>
|
||||
写入数据为原始数据的HEX串,相应的数据长度应为HEX串的一半
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="rwoffset">读写偏移</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<input type="text1" class="shortline" id="rwoffset" value="0"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<div class="lineleft">
|
||||
<label class="labelhead" for="dataLen">数据长度</label>
|
||||
</div>
|
||||
<div class="lineright">
|
||||
<input type="text1" class="shortline" id="dataLen" value=""/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="line">
|
||||
<input class="btn" type="button" value="整段写文件" onclick="WriteFile1()" />
|
||||
<input class="btn" type="button" value="整段读文件" onclick="ReadFile1()" />
|
||||
<input class="btn" type="button" value="分段写文件" onclick="WriteFile()" />
|
||||
<input class="btn" type="button" value="分段读文件" onclick="ReadFile()" />
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<input type="button" class="footclear" value="清空" onclick="clearconsole()" />
|
||||
<textarea class="footconsole" id="deviceManagerText" rows="8"></textarea>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
+1156
File diff suppressed because it is too large
Load Diff
+90
@@ -0,0 +1,90 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||
<title>SFK测试</title>
|
||||
<link rel='stylesheet' href="./css/styles.css" />
|
||||
<script type="text/javascript" src="./fiseckey.js"></script>
|
||||
</head>
|
||||
<script type="text/javascript">
|
||||
var dev = 0;
|
||||
var app = 0;
|
||||
var con = 0;
|
||||
var conname = 0;
|
||||
var flag = 0;
|
||||
|
||||
function seturl(dev,app,con,conname) {
|
||||
document.getElementById("indexhtml").href="./index.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("devhtml").href="./html/devicemanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("authhtml").href="./html/authmanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("apphtml").href="./html/appmanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("filehtml").href="./html/filemanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("containerhtml").href="./html/containermanager.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
document.getElementById("servicehtml").href="./html/service.html?dev="+dev+"&app="+app+"&con="+con+"&conname="+conname;
|
||||
flag = 1;
|
||||
}
|
||||
|
||||
function decodeurl() {
|
||||
var url = window.location.href;
|
||||
var tmp = url.split('?');
|
||||
var param = tmp[1].split('&');
|
||||
dev = param[0].split('=')[1];
|
||||
app = param[1].split('=')[1];
|
||||
con = param[2].split('=')[1];
|
||||
conname = param[3].split('=')[1];
|
||||
}
|
||||
|
||||
window.onload=function() {
|
||||
if(flag != 1)
|
||||
decodeurl();
|
||||
seturl(dev,app,con,conname);
|
||||
}
|
||||
|
||||
function reload() {
|
||||
if(flag != 1)
|
||||
decodeurl();
|
||||
seturl(dev,app,con,conname);
|
||||
}
|
||||
</script>
|
||||
<body>
|
||||
<div id="root">
|
||||
<header>
|
||||
<div>
|
||||
<h1 class="title">
|
||||
SKF FisecKey demo
|
||||
</h1>
|
||||
<ul class="menu">
|
||||
<li>
|
||||
<a id = indexhtml onclick="reload()" href="./index.html?dev=0&app=0&con=0" class='active'>简介</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = devhtml onclick="reload()" href="./html/devicemanager.html?dev=0&app=0&con=0">设备管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = apphtml onclick="reload()" href="./html/appmanager.html?dev=0&app=0&con=0">应用管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = authhtml onclick="reload()" href="./html/authmanager.html?dev=0&app=0&con=0">访问控制</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = filehtml onclick="reload()" href="./html/filemanager.html?dev=0&app=0&con=0">文件管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = containerhtml onclick="reload()" href="./html/containermanager.html?dev=0&app=0&con=0">容器管理</a>
|
||||
</li>
|
||||
<li>
|
||||
<a id = servicehtml onclick="reload()" href="./html/service.html?dev=0&app=0&con=0">密码服务</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</header>
|
||||
<main>
|
||||
<div class="content s1">
|
||||
<p>
|
||||
国标渔翁密码钥匙测试,适配版本3.1.0
|
||||
</p>
|
||||
</div>
|
||||
</main>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user