HardwareIdentification.GetPackageSpecificToken | getPackageSpecificToken method
Gets a hardware identifier (ASHWID) that represents the current hardware. The returned ASHWID will be different for each application package. In other words, this API will return different identifiers when called by two apps from different packages. It will return the same identifier when called by two apps that are part of the same package.
var hardwareToken = Windows.System.Profile.HardwareIdentification.getPackageSpecificToken(nonce);
The cryptographic nonce is optional. The nonce is recommended when ASHWID needs to be verified on the cloud against replay attacks. In the scenarios where nonce is desired, the remote server should generate a random nonce and pass it to the client app, and then verify that the signature has the expected nonce once the ASHWID is received from the client system.
The hardware Id information.
The GetPackageSpecificToken is designed for use by professional developers who have experience with licensing content and with sufficient expertise in cryptography
See Guidance on using the App Specific Hardware ID (ASHWID) to implement per-device app logic for more information.
The following code shows how to get the hardware id of a device using GetPackageSpecificToken.
// nonce is an IBuffer object that would be sent from the cloud service. var packageSpecificToken; packageSpecificToken = Windows.System.Profile.HardwareIdentification.getPackageSpecificToken(nonce); // hardware id, signature, certificate IBuffer objects // that can be accessed through properties. var hardwareId = packageSpecificToken.id; var signature = packageSpecificToken.signature; var certificate = packageSpecificToken.certificate;
Minimum supported client
Minimum supported server
|Windows Server 2012|
- Guidance on using the App Specific Hardware ID (ASHWID) to implement per-device app logic
Build date: 11/16/2013