Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create RxFingerprint instance via Builder instead of static methods #72

Merged
merged 1 commit into from
Mar 19, 2018

Conversation

Mauin
Copy link
Owner

@Mauin Mauin commented Dec 3, 2017

This is a proposal to move RxFingerprint away from it's static methods in the RxFingerprint class to access all RxFingerprint functions. Instead this proposal adds an RxFingerprint.Builder which would be used to create a concrete instance of RxFingerprint with all "constant" parameters defined per the instance. This results in easier and less duplicated methods for calling RxFingerprint encryption/decryption.

On the current master branch RxFingerprint has 5 methods with different parameters for encryption. This approach would simplify this and bring it down to 2 methods. This would make calling RxFingerprint clearer and would ensure that constant parameters are not changed across different calls to RxFingerprint.

Creating an RxFingerprint instance:

RxFingerprint rxFingerprint = new RxFingerprint.Builder(activity)
        .encryptionMethod(EncryptionMethod.RSA)
        .keyInvalidatedByBiometricEnrollment(true)
        .logger(new DefaultLogger())
        .build();

Encryption would then be simply calling:

Observable<FingerprintEncryptionResult> observable = rxFingerprint.encrypt(key, "Encrypt this, please")

Due to the breaking API changes this would result in a RxFingerprint v3.

@Mauin Mauin force-pushed the mr/rxfingerprint_builder branch from cd130bb to d042087 Compare March 13, 2018 07:54
@Mauin Mauin changed the base branch from master to 3.x March 19, 2018 07:05
@Mauin Mauin merged commit 0a5910f into 3.x Mar 19, 2018
@Mauin Mauin deleted the mr/rxfingerprint_builder branch March 19, 2018 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant