Check-in [e0f544bc9b]
Overview
Comment:ChromeOS: Added list of readers detected to smartcard UI
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: e0f544bc9b4b1ca3419f6b8111d2e5f2520217dc
User & Date: rkeene on 2016-03-09 04:48:56
Other Links: manifest | tags
Context
2016-03-09
04:53
ChromeOS: Updated to deal with the UI if the smartcard manager app isn't running check-in: e99cc9c924 user: rkeene tags: trunk
04:48
ChromeOS: Added list of readers detected to smartcard UI check-in: e0f544bc9b user: rkeene tags: trunk
04:40
ChromeOS: Fix issue where multiple calls made close together may have used the same ID check-in: 40765d7728 user: rkeene tags: trunk
Changes

Modified build/chrome/ui.html from [cc97e7803b] to [e2cfa8c888].

1
2
3
4
5
6
7
8
9

10
11
12
<html>
	<head>
		<title>CACKey</title>
		<script type="text/javascript" src="jsrsasign.js"></script>
		<script type="text/javascript" src="ui.js"></script>
	</head>
	<body>
		<h1>CACKey for Chrome</h1>
		<div>Certificate Provider: <span id="certificate_provider"></span></div>

		<div>Certificates: <span id="certificates"></span></div>
	</body>
</html>









>



1
2
3
4
5
6
7
8
9
10
11
12
13
<html>
	<head>
		<title>CACKey</title>
		<script type="text/javascript" src="jsrsasign.js"></script>
		<script type="text/javascript" src="ui.js"></script>
	</head>
	<body>
		<h1>CACKey for Chrome</h1>
		<div>Certificate Provider: <span id="certificate_provider"></span></div>
		<div>Smartcard Readers: <span id="smartcard_readers"></span></div>
		<div>Certificates: <span id="certificates"></span></div>
	</body>
</html>

Modified build/chrome/ui.js from [2cf5ac6095] to [fb29748971].

31
32
33
34
35
36
37
38



39
40
41
42
43
44
45
	}

	html += "</ol>";

	delete certObj;

	htmlObject.innerHTML = html;
}



function updateCertificates(htmlObject) {
	var html = "";

	if (globalCerts == null) {
		htmlObject.innerHTML = "<i>Updating...</i>";
	} else {
		displayCerts(htmlObject, globalCerts);







|
>
>
>







31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
	}

	html += "</ol>";

	delete certObj;

	htmlObject.innerHTML = html;

	return;
}

function updateCertificates(htmlObject) {
	var html = "";

	if (globalCerts == null) {
		htmlObject.innerHTML = "<i>Updating...</i>";
	} else {
		displayCerts(htmlObject, globalCerts);
53
54
55
56
57
58
59


60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78































79
80

81


82
		if (!certs) {
			certs = [];
		}

		globalCerts = certs;

		displayCerts(htmlObject, certs);


	});

	return;
}

function updateCertificateProvider(htmlObject) {
	var resultHTML;

	if (chrome.certificateProvider) {
		resultHTML = "Yes (ChromeOS)";
	} else {
		resultHTML = "<b>No, informational only.</b>";
	}

	htmlObject.innerHTML = resultHTML;

	return;
}
































setTimeout(function() {
	updateCertificates(document.getElementById('certificates'));

	updateCertificateProvider(document.getElementById('certificate_provider'));


}, 1);







>
>



















>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>


>

>
>

56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
		if (!certs) {
			certs = [];
		}

		globalCerts = certs;

		displayCerts(htmlObject, certs);

		return;
	});

	return;
}

function updateCertificateProvider(htmlObject) {
	var resultHTML;

	if (chrome.certificateProvider) {
		resultHTML = "Yes (ChromeOS)";
	} else {
		resultHTML = "<b>No, informational only.</b>";
	}

	htmlObject.innerHTML = resultHTML;

	return;
}

function updateSmartcardReaders(htmlObject) {
	parentWindow.cackeyListReaders(function(readers) {
		var idx;
		var reader;
		var resultHTML;

		resultHTML = "Count: " + readers.length;

		if (readers.length > 0) {
			resultHTML += "<br>";

			resultHTML += "<ol type=\"1\">";
			for (idx = 0; idx < readers.length; idx++) {
				reader = readers[idx];

				resultHTML += "<li>" + reader.readerName.trim() + ", card inserted: " + (reader.cardInserted ? "yes" : "no") + "</li>";
			}

			resultHTML += "</ol>";
		} else {
			resultHTML += " (is the Smartcard Manager Application working?)";
		}

		htmlObject.innerHTML = resultHTML;

		return;
	});

	return;
}

setTimeout(function() {
	updateCertificates(document.getElementById('certificates'));
	updateSmartcardReaders(document.getElementById('smartcard_readers'));
	updateCertificateProvider(document.getElementById('certificate_provider'));

	return;
}, 1);