alertmanager中fingerprint字段的实现

求使用 Java 语言实现对 alertmanager 中 fingerprint 字段的实现


回答:

private static void fingerprintImpl() {

try {

//创建fingerprint生成器

final FingerprintManager fingerprintManager = AndroidFingerprintManagerFactory.createFingerprintManager(null);

//创建fingerprint验证器

final FingerprintVerifier fingerprintVerifier = new FingerprintVerifier(fingerprintManager);

//创建fingerprint请求

final CreateFingerprintRequest createFingerprintRequest = new CreateFingerprintRequest.Builder().build();

//请求fingerprint

final CreateFingerprintResponse createFingerprintResponse = fingerprintManager.createFingerprint(createFingerprintRequest);

//验证fingerprint

final VerifyFingerprintResponse verifyFingerprintResponse = fingerprintVerifier.verify(createFingerprintResponse.getPayload());

//输出fingerprint

final String fingerprint = new String(verifyFingerprintResponse.getPayload());

Log.d(TAG, "fingerprint:" + fingerprint);

} catch (Exception e) {

e.printStackTrace();

}

}

以上是 alertmanager中fingerprint字段的实现 的全部内容, 来源链接: utcz.com/p/944528.html

回到顶部