Package org.webpki.crypto
Class DeviceID
java.lang.Object
org.webpki.crypto.DeviceID
Device ID generator.
A Device ID is a cryptographically secured 36-character identifier where the last 4 characters represent a (SHA1-based) checksum of the 160-bit SHA1 hash of the argument which is the actual identity. The identity used as input may be an IMEI-code, Device Certificate, Apple-ID, etc.
The scheme also supports a truncated 20-character Device ID-variant which presumably is sufficient for most real-world usages.
The checksum makes it easy verifying that the user has typed in the correct Device ID.
To further reduce mistakes the character-set has been limited to 32 visually
distinguishable characters:
ABCDEFGHJKLMNPQRSTUVWXYZ23456789
CCCC-CCCC-CCCC-CCCC CCCC-CCCC-CCCC-CCCC CCCC
-
Method Summary
Modifier and TypeMethodDescriptionstatic String
getDeviceId
(byte[] identityBlobOrNull, boolean longVersion) static String
getDeviceId
(X509Certificate deviceCertificateOrNull, boolean longVersion) static void
static void
validateDeviceID
(String deviceId)
-
Method Details
-
getDeviceId
-
getDeviceId
-
validateDeviceID
-
main
- Throws:
IOException
GeneralSecurityException
-