alertmanager中fingerprint字段的实现

才高八斗的杯子
  • 1
新手上路,请多包涵

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

回复
阅读 434
1 个回答
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();
    }
}
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏