當前位置: 首頁>>代碼示例>>Java>>正文


Java FingerprintManager.CryptoObject方法代碼示例

本文整理匯總了Java中android.hardware.fingerprint.FingerprintManager.CryptoObject方法的典型用法代碼示例。如果您正苦於以下問題:Java FingerprintManager.CryptoObject方法的具體用法?Java FingerprintManager.CryptoObject怎麽用?Java FingerprintManager.CryptoObject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在android.hardware.fingerprint.FingerprintManager的用法示例。


在下文中一共展示了FingerprintManager.CryptoObject方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: startFingerprintAuth

import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
@RequiresApi(api = Build.VERSION_CODES.M)
private void startFingerprintAuth() throws GeneralSecurityException, IOException {
    Signature signature = Signature.getInstance("SHA256withECDSA");
    PrivateKey privateKey = fidoKeystore.getKeyPair(Preferences.getSettingsParam("username")).getPrivate();
    signature.initSign(privateKey);

    FingerprintAuthenticationDialogFragment fragment
            = new FingerprintAuthenticationDialogFragment();
    FingerprintManager.CryptoObject cryptoObj = new FingerprintManager.CryptoObject(signature);
    fragment.setCryptoObject(cryptoObj);
    fragment.setStage(
            FingerprintAuthenticationDialogFragment.Stage.FINGERPRINT);

    Log.d(TAG, "Showing fragment: " + fragment);
    fragment.show(getFragmentManager(), DIALOG_FRAGMENT_TAG);
}
 
開發者ID:eBay,項目名稱:UAF,代碼行數:17,代碼來源:ExampleFidoUafActivity.java

示例2: startAuth

import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
public void startAuth(FingerprintManager manager,
                      FingerprintManager.CryptoObject cryptoObject) {

    cancellationSignal = new CancellationSignal();

    if (ActivityCompat.checkSelfPermission(context,
            Manifest.permission.USE_FINGERPRINT) !=
            PackageManager.PERMISSION_GRANTED) {
        return;
    }
    manager.authenticate(cryptoObject, cancellationSignal, 0, this, null);
}
 
開發者ID:noosomii,項目名稱:FingerprintDemo,代碼行數:13,代碼來源:FingerprintHelper.java

示例3: setupFingerprintStuff

import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
@RequiresApi(api = Build.VERSION_CODES.M)
public void setupFingerprintStuff() {
    fingerprintManager = (FingerprintManager) this.getSystemService(Context.FINGERPRINT_SERVICE);
    fingerprintHelper = new FingerprintHelper(this);
    try {
        generateKey();

        if (cipherInit()) {
            cryptoObject = new FingerprintManager.CryptoObject(cipher);
            fingerprintHelper.startAuth(fingerprintManager, cryptoObject);
        }

    } catch (Exception ex) {
        ex.printStackTrace();
    }
}
 
開發者ID:manuelsc,項目名稱:Lunary-Ethereum-Wallet,代碼行數:17,代碼來源:AppLockActivity.java

示例4: begin

import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
public PublishSubject<Boolean> begin() {

        if(publishSubject == null){
            publishSubject = PublishSubject.create();
        }
        if (Build.VERSION.SDK_INT < 23){
            publishSubject.onError(new FPerException(SYSTEM_API_ERROR));
        }else {
            initManager();
            confirmFinger();
            try {
                CryptoObjectHelper helper = new CryptoObjectHelper();
                FingerprintManager.CryptoObject cryptoObject = helper.buildCryptoObject();
                startListening(cryptoObject);
            } catch (Exception e) {
                e.printStackTrace();
            }
//            startListening(null);
        }
        return publishSubject;

    }
 
開發者ID:Alex-Jerry,項目名稱:LLApp,代碼行數:23,代碼來源:RxFingerPrinter.java

示例5: scanFingerprint

import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
private boolean scanFingerprint() throws CertificateException, NoSuchAlgorithmException,
        IOException, UnrecoverableKeyException, KeyStoreException, InvalidKeyException,
        InvalidAlgorithmParameterException, NoSuchPaddingException {

    FingerprintManager fingerprintManager = (FingerprintManager) getSystemService(FINGERPRINT_SERVICE);

    //noinspection ResourceType
    if (fingerprintManager.isHardwareDetected()) {

        Cipher cipher = getCipherInstance();

        IvParameterSpec ivSpec = new IvParameterSpec(mIvData);
        SecretKey key = (SecretKey) mKeyStore.getKey(KEY_NAME, null);
        cipher.init(Cipher.DECRYPT_MODE, key, ivSpec);

        FingerprintManager.CryptoObject cryptoObject = new FingerprintManager.CryptoObject(cipher);

        //noinspection ResourceType
        fingerprintManager.authenticate(cryptoObject, mCancellationSignal, 0x0, mAuthenticationCallback, mHandler);

        return true;
    } else {
        return false;
    }
}
 
開發者ID:keiji,項目名稱:simple-marshmallow-samples,代碼行數:26,代碼來源:FingerprintActivity.java

示例6: startListening

import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
/**
 * Starts listening to {@link FingerprintManager}
 *
 * @throws SecurityException If the hardware is not available, or the permission are not set
 */
public void startListening() throws SecurityException {
    if (initCipher()) {
        FingerprintManager.CryptoObject cryptoObject = new FingerprintManager.CryptoObject(mCipher);
        if (!isFingerprintAuthAvailable()) {
            return;
        }
        mCancellationSignal = new CancellationSignal();
        mSelfCancelled = false;
        mFingerprintManager.authenticate(cryptoObject, mCancellationSignal, 0 /* flags */, this, null);
        mIcon.setImageResource(R.drawable.ic_fp_40px);
    }
}
 
開發者ID:sfilmak,項目名稱:MakiLite,代碼行數:18,代碼來源:FingerprintUiHelper.java

示例7: startListening

import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
@TargetApi(Build.VERSION_CODES.M)
public void startListening(FingerprintManager.CryptoObject cryptoObject) {
    //android studio 上,沒有這個會報錯
    if (ActivityCompat.checkSelfPermission(context, Manifest.permission.USE_FINGERPRINT)
            != PackageManager.PERMISSION_GRANTED) {
        throw new FPerException(PERMISSION_DENIED_ERROE);
    }
    manager.authenticate(cryptoObject, null, 0, mSelfCancelled, null);
}
 
開發者ID:angcyo,項目名稱:RLibrary,代碼行數:10,代碼來源:RxFingerPrinter.java

示例8: startAuth

import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
public void startAuth(FingerprintManager manager, FingerprintManager.CryptoObject cryptoObject) {

        if (mContext != null)
            if (mContext.checkSelfPermission(Manifest.permission.USE_FINGERPRINT) != PackageManager.PERMISSION_GRANTED) {
                Toast.makeText(mContext, "Fingerprint permission denied", Toast.LENGTH_SHORT).show();
                return;
            }
        cancellationSignal = new CancellationSignal();
        manager.authenticate(cryptoObject, cancellationSignal, 0, this, null);
    }
 
開發者ID:aboutZZ,項目名稱:WeChatFingerprintPay,代碼行數:11,代碼來源:FingerprintHandler.java

示例9: startAuth

import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
@TargetApi(23)
public void startAuth(FingerprintManager manager, FingerprintManager.CryptoObject cryptoObject) {
    CancellationSignal cancellationSignal = new CancellationSignal();
    if (ActivityCompat.checkSelfPermission(context, Manifest.permission.USE_FINGERPRINT) != PackageManager.PERMISSION_GRANTED) {
        return;
    }
    manager.authenticate(cryptoObject, cancellationSignal, 0, this, null);
}
 
開發者ID:michelelacorte,項目名稱:FlickLauncher,代碼行數:9,代碼來源:FingerprintHandler.java

示例10: startAuth

import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
public void startAuth(FingerprintManager manager, FingerprintManager.CryptoObject cryptoObject) {

        cancellationSignal = new CancellationSignal();
        if (ActivityCompat.checkSelfPermission(context, Manifest.permission.USE_FINGERPRINT) != PackageManager.PERMISSION_GRANTED) {
            return;
        }
        manager.authenticate(cryptoObject, cancellationSignal, 0, this, null);
    }
 
開發者ID:anonymous-ME,項目名稱:Automata,代碼行數:9,代碼來源:FingerprintHandler.java

示例11: wrapCryptoObject

import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
private static FingerprintManager.CryptoObject wrapCryptoObject(CryptoObject cryptoObject) {
    if (cryptoObject == null) {
        return null;
    } else if (cryptoObject.getCipher() != null) {
        return new FingerprintManager.CryptoObject(cryptoObject.getCipher());
    } else if (cryptoObject.getSignature() != null) {
        return new FingerprintManager.CryptoObject(cryptoObject.getSignature());
    } else if (cryptoObject.getMac() != null) {
        return new FingerprintManager.CryptoObject(cryptoObject.getMac());
    } else {
        return null;
    }
}
 
開發者ID:uccmawei,項目名稱:FingerprintIdentify,代碼行數:14,代碼來源:FingerprintManagerCompatApi23.java

示例12: onFingerprintAuthSuccess

import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
@Override
public void onFingerprintAuthSuccess(FingerprintManager.CryptoObject cryptoObject) {
    mCurrentStatusText = "Fingerprint recognized";
    getRootView().invalidate();

    new android.os.Handler().postDelayed(new Runnable() {
        @Override
        public void run() {
            if (mAuthListener != null) mAuthListener.onAuthenticationSuccessful();
            mCurrentStatusText = mNormalStatusText;
            getRootView().invalidate();
        }
    }, 1000);
}
 
開發者ID:kevalpatel2106,項目名稱:PasscodeView,代碼行數:15,代碼來源:BoxFingerprint.java

示例13: unwrapCryptoObject

import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
private static CryptoObject unwrapCryptoObject(FingerprintManager.CryptoObject cryptoObject) {
    if (cryptoObject == null) {
        return null;
    } else if (cryptoObject.getCipher() != null) {
        return new CryptoObject(cryptoObject.getCipher());
    } else if (cryptoObject.getSignature() != null) {
        return new CryptoObject(cryptoObject.getSignature());
    } else if (cryptoObject.getMac() != null) {
        return new CryptoObject(cryptoObject.getMac());
    } else {
        return null;
    }
}
 
開發者ID:uccmawei,項目名稱:FingerprintIdentify,代碼行數:14,代碼來源:FingerprintManagerCompatApi23.java

示例14: startListening

import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
/**
 * @param manager      FingerprintManager instance
 * @param cryptoObject Crypto object
 */
public void startListening(FingerprintManager manager, FingerprintManager.CryptoObject cryptoObject) {
    listeningState = true;
    cancellationSignal = new CancellationSignal();
    if (ActivityCompat.checkSelfPermission(context, Manifest.permission.USE_FINGERPRINT) != PackageManager.PERMISSION_GRANTED) {
        return;
    }
    manager.authenticate(cryptoObject, cancellationSignal, 0, this, null);
}
 
開發者ID:dev-prajwal21,項目名稱:FingerprintAssistant,代碼行數:13,代碼來源:FingerprintResultsHandler.java

示例15: startListening

import android.hardware.fingerprint.FingerprintManager; //導入方法依賴的package包/類
public void startListening(FingerprintManager.CryptoObject cryptoObject) {
    if (!isFingerprintAuthAvailable()) {
        return;
    }
    mCancellationSignal = new CancellationSignal();
    mSelfCancelled = false;
    mFingerprintManager
            .authenticate(cryptoObject, mCancellationSignal, 0 /* flags */, this, null);

    int ic_fp_40px_id = mContext.getResources()
            .getIdentifier("ic_fp_40px", "drawable", FingerprintAuth.packageName);
    mIcon.setImageResource(ic_fp_40px_id);
}
 
開發者ID:mjwheatley,項目名稱:cordova-plugin-android-fingerprint-auth,代碼行數:14,代碼來源:FingerprintUiHelper.java


注:本文中的android.hardware.fingerprint.FingerprintManager.CryptoObject方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。