通过最新的Windows周年更新,Edge现在支持使用Windows Hello进行生物识别身份验证(参见https://developer.microsoft.com/en-us/microsoft-edge/platform/documentation/dev-guide/device/web-authentication / ,https://blogs.windows.com/msedgedev/2016/04/12/a-world-without-passwords-windows-hello-in-microsoft-edge/)
我在C#,PHP和Node.js中有一些示例,我试图让它在Go中运行.
以下在JS中工作(我在挑战和密钥中硬编码):
function parseBase64(s) {
s = s.replace(/-/g, "+").replace(/_/g, "/").replace(/\s/g, '');
return new Uint8Array(Array.prototype.map.call(atob(s), function (c) { return c.charCodeAt(0) }));
}
function concatUint8Array(a1,a2) {
var d = new Uint8Array(a1.length + a2.length);
d.set(a1);
d.set(a2,a1.length);
return d;
}
var credAlgorithm = "RSASSA-PKCS1-v1_5";
var id,authenticatorData,signature,hash;
webauthn.getAssertion("chalenge").then(function(assertion) {
id = assertion.credential.id;
authenticatorData = assertion.authenticatorData;
signature = assertion.signature;
return crypto.subtle.digest("SHA-256",parseBase64(assertion.clientData));
}).then(function(h) {
hash = new Uint8Array(h);
var publicKey = "{\"kty\":\"RSA\",\"alg\":\"RS256\",\"ext\":false,\"n\":\"mEqGJwp0GL1oVwjRikkNfzd-Rkpb7vIbGodwQkTDsZT4_UE02WDaRa-PjxzL4lPZ4rUpV5SqVxM25aEIeGkEOR_8Xoqx7lpNKNOQs3E_o8hGBzQKpGcA7de678LeAUZdJZcnnQxXYjNf8St3aOIay7QrPoK8wQHEvv8Jqg7O1-pKEKCIwSKikCFHTxLhDDRo31KFG4XLWtLllCfEO6vmQTseT-_8OZPBSHOxR9VhIbY7VBhPq-PeAWURn3G52tQX-802waGmKBZ4B87YtEEPxCNbyyvlk8jRKP1KIrI49bgJhAe5Mow3yycQEnGuPDwLzmJ1lU6I4zgkyL1jI3Ghsw\",\"e\":\"AQAB\"}";
return crypto.subtle.importKey("jwk",JSON.parse(publicKey),credAlgorithm,false,["verify"]);
}).then(function(key) {
return crypto.subtle.verify({name:credAlgorithm, hash: { …
Run Code Online (Sandbox Code Playgroud) Windows Hello 摄像头使用红外摄像头和红外发射器,并将两者结合起来感测帧中的深度。它类似于 Apple 的 FaceID 或 Xbox Kinect 中的技术。访问 Windows Hello 摄像头的深度传感功能对于研究人员和应用程序开发人员来说可能非常有价值。
\n我能够创建一个应用程序,该应用程序能够访问嵌入在启用 Windows Hello 的网络摄像头中的红外摄像头。然而我发现红外发射器的行为不一致。我已将代码发布到上面链接的 github 存储库中。
\n在我能够访问红外摄像机的每一帧后,我意识到我的摄像机没有打开Infrared Torch
(摄像机红外发射器 LED)。但我知道红外手电筒可以工作,因为当我使用 Windows Hello 的面部识别功能时,红外手电筒确实会打开。
我发现驱动程序级别的 Windows 红外摄像头具有以下红外手电筒模式:
\n触摸模式 | 描述 |
---|---|
KSCAMERA_EXTENDEDPROP_IRTORCHMODE_OFF | Off |
KSCAMERA_EXTENDEDPROP_IRTORCHMODE_ALWAYS_ON | Always on |
KSCAMERA_EXTENDEDPROP_IRTORCHMODE_ALTERNATING_FRAME_ILLUMINATION … |
我想使用 存储和检索密码Windows Hello
。用户可以在登录时选择是否要手动输入密码,或者是否要使用Windows Hello
解锁(然后检索上次使用的密码,并为用户填写)。
如果Windows Hello
设置正确,文档中有两个用例。
只需解锁即可:
UserConsentVerificationResult consentResult = await UserConsentVerifier.RequestVerificationAsync("userMessage");
if (consentResult.Equals(UserConsentVerificationResult.Verified))
{
// continue
}
Run Code Online (Sandbox Code Playgroud)
以及对来自服务器的消息进行签名的方法:
var openKeyResult = await KeyCredentialManager.OpenAsync(AccountId);
if (openKeyResult.Status == KeyCredentialStatus.Success)
{
var userKey = openKeyResult.Credential;
var publicKey = userKey.RetrievePublicKey();
//the message is the challenge from the server
var signResult = await userKey.RequestSignAsync(message);
if (signResult.Status == KeyCredentialStatus.Success)
{
//the with the private key of the user signed message
return signResult.Result;
}
}
Run Code Online (Sandbox Code Playgroud)
两者对于我的用例来说都不是很有用:我想要一种对称的方式来存储和检索密码。
简而言之,我的问题是:
有没有办法对称存储数据Windows Hello …
我可以编写一个代码块,在单击按钮时打开 Windows Hello 窗口并根据密码的正确性采取操作吗?如果我会写,我会怎样写?
我正在研究:Windows Forms .NET Framework (C#)
有谁知道 Windows Hello 中的安全凭据位于何处以及如何删除它们?
我正在使用 Web 身份验证 API 实现身份验证,并且在处理代码时我创建了数百个凭据,我想以某种方式删除它们。
navigator.credential.get({ ... })
Run Code Online (Sandbox Code Playgroud)
只需调用get()
一两分钟即可加载所有这些并显示此对话框: