From 3e70c435f93ec8a3c1c5fab6442a20c2d3cfcf91 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20=C4=8Eurech?= Date: Tue, 1 Oct 2024 10:20:23 +0200 Subject: [PATCH 1/3] Fix #629: Remove interfaces deprecated in 1.8.x --- ...ICommitActivationWithBiometryListener.java | 25 -- .../sdk/PowerAuthAuthentication.java | 93 ------- .../security/powerauth/sdk/PowerAuthSDK.java | 237 ------------------ .../PowerAuth2/PowerAuthAuthentication.h | 106 -------- .../PowerAuth2/PowerAuthAuthentication.m | 38 --- proj-xcode/PowerAuth2/PowerAuthSDK.h | 34 --- proj-xcode/PowerAuth2/PowerAuthSDK.m | 22 -- 7 files changed, 555 deletions(-) delete mode 100644 proj-android/PowerAuthLibrary/src/main/java/io/getlime/security/powerauth/biometry/ICommitActivationWithBiometryListener.java diff --git a/proj-android/PowerAuthLibrary/src/main/java/io/getlime/security/powerauth/biometry/ICommitActivationWithBiometryListener.java b/proj-android/PowerAuthLibrary/src/main/java/io/getlime/security/powerauth/biometry/ICommitActivationWithBiometryListener.java deleted file mode 100644 index 48f8b771..00000000 --- a/proj-android/PowerAuthLibrary/src/main/java/io/getlime/security/powerauth/biometry/ICommitActivationWithBiometryListener.java +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright 2019 Wultra s.r.o. - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package io.getlime.security.powerauth.biometry; - -/** - * Interface used as a callback for persisting the activation with biometric authentication. - * @deprecated Use {@link IPersistActivationWithBiometricsListener} as a replacement. - */ -@Deprecated // 1.8.0 -public interface ICommitActivationWithBiometryListener extends IPersistActivationWithBiometricsListener { -} diff --git a/proj-android/PowerAuthLibrary/src/main/java/io/getlime/security/powerauth/sdk/PowerAuthAuthentication.java b/proj-android/PowerAuthLibrary/src/main/java/io/getlime/security/powerauth/sdk/PowerAuthAuthentication.java index c7e6e946..257d95d4 100644 --- a/proj-android/PowerAuthLibrary/src/main/java/io/getlime/security/powerauth/sdk/PowerAuthAuthentication.java +++ b/proj-android/PowerAuthLibrary/src/main/java/io/getlime/security/powerauth/sdk/PowerAuthAuthentication.java @@ -195,99 +195,6 @@ public static PowerAuthAuthentication persistWithPasswordAndBiometry(@NonNull Pa return new PowerAuthAuthentication(true, password, biometryFactorRelatedKey, overriddenPossessionKey); } - - // Commit activation (deprecated) - - /** - * Construct authentication object for activation commit with password. - * @param password Password to set for new activation. - * @return Authentication object constructed for commit activation with the password. - */ - @Deprecated // 1.8.0 - public static PowerAuthAuthentication commitWithPassword(@NonNull String password) { - return persistWithPassword(password); - } - - /** - * Construct authentication object for activation commit with password and custom key for the possession factor. - * @param password Password to set for new activation. - * @param overriddenPossessionKey Custom possession key to set for new activation. - * @return Authentication object constructed for commit activation and password, with using custom key for the possession factor. - */ - @Deprecated // 1.8.0 - public static PowerAuthAuthentication commitWithPassword(@NonNull String password, @NonNull byte[] overriddenPossessionKey) { - return persistWithPassword(password, overriddenPossessionKey); - } - - /** - * Construct authentication object for activation commit with password and with biometry. - * @param password Password to set for new activation. - * @param biometryFactorRelatedKey Biometry factor related key to set for new activation. - * @return Authentication object constructed for commit activation with password and biometry. - */ - @Deprecated // 1.8.0 - public static PowerAuthAuthentication commitWithPasswordAndBiometry(@NonNull String password, @NonNull byte[] biometryFactorRelatedKey) { - return persistWithPasswordAndBiometry(password, biometryFactorRelatedKey); - } - - /** - * Construct authentication object for activation commit with password, biometry and with custom key for the possession factor. - * @param password Password to set for new activation. - * @param biometryFactorRelatedKey Biometry factor related key to set for new activation. - * @param overriddenPossessionKey Custom possession key to set for new activation. - * @return Authentication object constructed for commit activation with password, with using custom key for the possession factor. - */ - @Deprecated // 1.8.0 - public static PowerAuthAuthentication commitWithPasswordAndBiometry(@NonNull String password, @NonNull byte[] biometryFactorRelatedKey, @NonNull byte[] overriddenPossessionKey) { - return persistWithPasswordAndBiometry(password, biometryFactorRelatedKey, overriddenPossessionKey); - } - - // core/Password variants - - /** - * Construct authentication object for activation commit with password. - * @param password Password to set for new activation. - * @return Authentication object constructed for commit activation with the password. - */ - @Deprecated // 1.8.0 - public static PowerAuthAuthentication commitWithPassword(@NonNull Password password) { - return persistWithPassword(password); - } - - /** - * Construct authentication object for activation commit with password and custom key for the possession factor. - * @param password Password to set for new activation. - * @param overriddenPossessionKey Custom possession key to set for new activation. - * @return Authentication object constructed for commit activation and password, with using custom key for the possession factor. - */ - @Deprecated // 1.8.0 - public static PowerAuthAuthentication commitWithPassword(@NonNull Password password, @NonNull byte[] overriddenPossessionKey) { - return persistWithPassword(password, overriddenPossessionKey); - } - - /** - * Construct authentication object for activation commit with password and with biometry. - * @param password Password to set for new activation. - * @param biometryFactorRelatedKey Biometry factor related key to set for new activation. - * @return Authentication object constructed for commit activation with password and biometry. - */ - @Deprecated // 1.8.0 - public static PowerAuthAuthentication commitWithPasswordAndBiometry(@NonNull Password password, @NonNull byte[] biometryFactorRelatedKey) { - return persistWithPasswordAndBiometry(password, biometryFactorRelatedKey); - } - - /** - * Construct authentication object for activation commit with password, biometry and with custom key for the possession factor. - * @param password Password to set for new activation. - * @param biometryFactorRelatedKey Biometry factor related key to set for new activation. - * @param overriddenPossessionKey Custom possession key to set for new activation. - * @return Authentication object constructed for commit activation with password, with using custom key for the possession factor. - */ - @Deprecated // 1.8.0 - public static PowerAuthAuthentication commitWithPasswordAndBiometry(@NonNull Password password, @NonNull byte[] biometryFactorRelatedKey, @NonNull byte[] overriddenPossessionKey) { - return persistWithPasswordAndBiometry(password, biometryFactorRelatedKey, overriddenPossessionKey); - } - // Authenticate /** diff --git a/proj-android/PowerAuthLibrary/src/main/java/io/getlime/security/powerauth/sdk/PowerAuthSDK.java b/proj-android/PowerAuthLibrary/src/main/java/io/getlime/security/powerauth/sdk/PowerAuthSDK.java index 9744fe9a..44e812bf 100644 --- a/proj-android/PowerAuthLibrary/src/main/java/io/getlime/security/powerauth/sdk/PowerAuthSDK.java +++ b/proj-android/PowerAuthLibrary/src/main/java/io/getlime/security/powerauth/sdk/PowerAuthSDK.java @@ -1154,195 +1154,6 @@ public int persistActivationWithAuthentication(@NonNull Context context, @NonNul } } - // Deprecated activation commit - - /** - * Persist activation that was created and store related data using default authentication instance setup with provided password. - * - * @param context Context - * @param password Password to be used for the knowledge related authentication factor. - * @return int {@link PowerAuthErrorCodes} error code. - * @throws PowerAuthMissingConfigException thrown in case configuration is not present. - * @deprecated Use {@link #persistActivationWithPassword(Context, String)} as a replacement. - */ - @CheckResult - @PowerAuthErrorCodes - @Deprecated // 1.8.0 - public int commitActivationWithPassword(@NonNull Context context, @NonNull String password) { - return persistActivationWithPassword(context, password); - } - - /** - * Persist activation that was created and store related data using default authentication instance setup with provided password. - * - * @param context Context - * @param password Password to be used for the knowledge related authentication factor. - * @return int {@link PowerAuthErrorCodes} error code. - * @throws PowerAuthMissingConfigException thrown in case configuration is not present. - * @deprecated Use {@link #persistActivationWithPassword(Context, Password)} as a replacement. - */ - @CheckResult - @PowerAuthErrorCodes - @Deprecated // 1.8.0 - public int commitActivationWithPassword(@NonNull Context context, @NonNull Password password) { - return persistActivationWithPassword(context, password); - } - - /** - * Persist activation that was created and store related data using provided authentication instance. - * - * @param context android context object - * @param authentication An authentication instance specifying what factors should be stored. - * @return int {@link PowerAuthErrorCodes} error code. - * @throws PowerAuthMissingConfigException thrown in case configuration is not present. - * @deprecated Use {@link #persistActivationWithAuthentication(Context, PowerAuthAuthentication)} as a replacement. - */ - @CheckResult - @PowerAuthErrorCodes - @Deprecated // 1.8.0 - public int commitActivationWithAuthentication(@NonNull Context context, @NonNull PowerAuthAuthentication authentication) { - return persistActivationWithAuthentication(context, authentication); - } - - /** - * Persist activation that was created and store related data using default authentication instance setup with provided password. - *

- * Calling this method is equivalent to {@link #persistActivationWithAuthentication(Context, PowerAuthAuthentication)} with authentication object set to use all factors and provided password. - * - * @param context Context - * @param password Password to be used for the knowledge related authentication factor. - * @param encryptedBiometryKey Optional biometry related factor key. - * @return int {@link PowerAuthErrorCodes} error code. - * @throws PowerAuthMissingConfigException thrown in case configuration is not present. - * @deprecated Use {@link #persistActivationWithPassword(Context, Password, byte[])} as a replacement. - */ - @CheckResult - @PowerAuthErrorCodes - @Deprecated // 1.8.0 - public int commitActivationWithPassword(@NonNull Context context, @NonNull Password password, @Nullable byte[] encryptedBiometryKey) { - return persistActivationWithPassword(context, password, encryptedBiometryKey); - } - - /** - * Persist activation that was created and store related data using default authentication instance setup with provided password. - *

- * Calling this method is equivalent to {@link #persistActivationWithAuthentication(Context, PowerAuthAuthentication)} with authentication object set to use all factors and provided password. - * - * @param context Context - * @param password Password to be used for the knowledge related authentication factor. - * @param encryptedBiometryKey Optional biometry related factor key. - * @return int {@link PowerAuthErrorCodes} error code. - * @throws PowerAuthMissingConfigException thrown in case configuration is not present. - * @deprecated Use {@link #persistActivationWithPassword(Context, String, byte[])} as a replacement. - */ - @CheckResult - @PowerAuthErrorCodes - @Deprecated // 1.8.0 - public int commitActivationWithPassword(@NonNull Context context, @NonNull String password, @Nullable byte[] encryptedBiometryKey) { - return persistActivationWithPassword(context, password, encryptedBiometryKey); - } - - /** - * Persist activation that was created and store related data using default authentication instance setup with provided password and biometry key. - * - * @param context Context. - * @param fragment Fragment of the application that will host the prompt. - * @param title Dialog title. - * @param description Dialog description. - * @param password Password used to persist activation. - * @param callback Callback with the authentication result. - * @return {@link ICancelable} object associated with the biometric prompt. - * @deprecated Use {@link #persistActivation(Context, Fragment, String, String, Password, IPersistActivationWithBiometricsListener)} as a replacement. - */ - @UiThread - @NonNull - @Deprecated // 1.8.0 - public ICancelable commitActivation( - final @NonNull Context context, - @NonNull Fragment fragment, - @NonNull String title, - @NonNull String description, - @NonNull final Password password, - final @NonNull IPersistActivationWithBiometricsListener callback) { - return persistActivation(context, fragment, title, description, password, callback); - } - - /** - * Persist activation that was created and store related data using default authentication instance setup with provided password and biometry key. - * - * @param context Context. - * @param fragment Fragment of the application that will host the prompt. - * @param title Dialog title. - * @param description Dialog description. - * @param password Password used to persist activation. - * @param callback Callback with the authentication result. - * @return {@link ICancelable} object associated with the biometric prompt. - * @deprecated Use {@link #persistActivation(Context, Fragment, String, String, String, IPersistActivationWithBiometricsListener)} as a replacement. - */ - @UiThread - @NonNull - @Deprecated // 1.8.0 - public ICancelable commitActivation( - final @NonNull Context context, - @NonNull Fragment fragment, - @NonNull String title, - @NonNull String description, - @NonNull final String password, - final @NonNull IPersistActivationWithBiometricsListener callback) { - return persistActivation(context, fragment, title, description, password, callback); - } - - /** - * Persist activation that was created and store related data using default authentication instance setup with provided password and biometry key. - * - * @param context Context. - * @param fragmentActivity Activity of the application that will host the prompt. - * @param title Dialog title. - * @param description Dialog description. - * @param password Password used to persist activation. - * @param callback Callback with the authentication result. - * @return {@link ICancelable} object associated with the biometric prompt. - * @deprecated Use {@link #persistActivation(Context, FragmentActivity, String, String, String, IPersistActivationWithBiometricsListener)} as a replacement. - */ - @UiThread - @NonNull - @Deprecated // 1.8.0 - public ICancelable commitActivation( - final @NonNull Context context, - @NonNull FragmentActivity fragmentActivity, - @NonNull String title, - @NonNull String description, - @NonNull final String password, - final @NonNull IPersistActivationWithBiometricsListener callback) { - return persistActivation(context, fragmentActivity, title, description, password, callback); - } - - /** - * Persist activation that was created and store related data using default authentication instance setup with provided password and biometry key. - * - * @param context Context. - * @param fragmentActivity Activity of the application that will host the prompt. - * @param title Dialog title. - * @param description Dialog description. - * @param password Password used to persist activation. - * @param callback Callback with the authentication result. - * @return {@link ICancelable} object associated with the biometric prompt. - * @deprecated Use {@link #persistActivation(Context, FragmentActivity, String, String, Password, IPersistActivationWithBiometricsListener)} as a replacement. - */ - @UiThread - @NonNull - @Deprecated // 1.8.0 - public ICancelable commitActivation( - final @NonNull Context context, - @NonNull FragmentActivity fragmentActivity, - @NonNull String title, - @NonNull String description, - @NonNull final Password password, - final @NonNull IPersistActivationWithBiometricsListener callback) { - return persistActivation(context, fragmentActivity, title, description, password, callback); - } - - // // User Info // @@ -2406,54 +2217,6 @@ public void onBiometricDialogFailed(@NonNull PowerAuthErrorException error) { }; } - /** - * Authenticate a client using biometric authentication. In case of the authentication is successful and - * {@link IBiometricAuthenticationCallback#onBiometricDialogSuccess(BiometricKeyData)} callback is called. - * - * @param context Context. - * @param fragment The fragment of the application that will host the prompt. - * @param title Dialog title. - * @param description Dialog description. - * @param callback Callback with the authentication result. - * @return {@link ICancelable} object associated with the biometric prompt. - * @deprecated Use {@link #authenticateUsingBiometrics(Context, Fragment, String, String, IAuthenticateWithBiometricsListener)} as a replacement. - */ - @UiThread - @NonNull - @Deprecated // 1.8.0 - public ICancelable authenticateUsingBiometry( - @NonNull Context context, - @NonNull Fragment fragment, - @NonNull String title, - @NonNull String description, - final @NonNull IBiometricAuthenticationCallback callback) { - return authenticateUsingBiometrics(context, FragmentHelper.from(fragment), title, description, false, callback); - } - - /** - * Authenticate a client using biometric authentication. In case of the authentication is successful and - * {@link IBiometricAuthenticationCallback#onBiometricDialogSuccess(BiometricKeyData)} callback is called, - * - * @param context Context. - * @param fragmentActivity The activity of the application that will host the prompt. - * @param title Dialog title. - * @param description Dialog description. - * @param callback Callback with the authentication result. - * @return {@link ICancelable} object associated with the biometric prompt. - * @deprecated Use {@link #authenticateUsingBiometrics(Context, FragmentActivity, String, String, IAuthenticateWithBiometricsListener)} as a replacement. - */ - @UiThread - @NonNull - @Deprecated // 1.8.0 - public ICancelable authenticateUsingBiometry( - @NonNull Context context, - @NonNull FragmentActivity fragmentActivity, - @NonNull String title, - @NonNull String description, - final @NonNull IBiometricAuthenticationCallback callback) { - return authenticateUsingBiometrics(context, FragmentHelper.from(fragmentActivity), title, description, false, callback); - } - /** * Authenticate a client using biometric authentication. * diff --git a/proj-xcode/PowerAuth2/PowerAuthAuthentication.h b/proj-xcode/PowerAuth2/PowerAuthAuthentication.h index 914445ea..ee721f32 100644 --- a/proj-xcode/PowerAuth2/PowerAuthAuthentication.h +++ b/proj-xcode/PowerAuth2/PowerAuthAuthentication.h @@ -104,61 +104,6 @@ customPossessionKey:(nullable NSData*)customPossessionKey NS_SWIFT_NAME(persistWithPasswordAndBiometry(password:customBiometryKey:customPossessionKey:)); -// Deprecated Commit - -/// Create a new instance of authentication object configured for activation commit with password. -/// -/// Function is not available for App extensions and on watchOS. -/// -/// @param password Password used for the knowledge factor. -/// @return Instance of authentication object configured for activation commit with password. -/// @deprecated Use `persistWithPassword(password:)` as a replacement. -+ (nonnull PowerAuthAuthentication*) commitWithPassword:(nonnull NSString*)password - NS_SWIFT_NAME(commitWithPassword(password:)) - PA2_DEPRECATED(1.8.0); - -/// Create a new instance of authentication object configured for activation commit with password and custom possession key. -/// -/// Function is not available for App extensions and on watchOS. -/// -/// @param password Password used for the knowledge factor. -/// @param customPossessionKey Custom key used for possession factor. -/// @return Instance of authentication object configured for activation commit with password and custom possession key. -/// @deprecated Use `persistWithPassword(password:customPossessionKey:)` as a replacement. -+ (nonnull PowerAuthAuthentication*) commitWithPassword:(nonnull NSString*)password - customPossessionKey:(nonnull NSData*)customPossessionKey - NS_SWIFT_NAME(commitWithPassword(password:customPossessionKey:)) - PA2_DEPRECATED(1.8.0); - -// Commit, Possession + Knowledge + Biometry - -/// Create a new instance of authentication object configured for activation commit with password and with biometry. -/// -/// Function is not available for App extensions and on watchOS. -/// -/// @param password Password used for the knowledge factor. -/// @return Instance of authentication object configured for activation commit with password and biometry. -/// @deprecated Use `persistWithPasswordAndBiometry(password:)` as a replacement. -+ (nonnull PowerAuthAuthentication*) commitWithPasswordAndBiometry:(nonnull NSString*)password - NS_SWIFT_NAME(commitWithPasswordAndBiometry(password:)) - PA2_DEPRECATED(1.8.0); - -/// Create a new instance of authentication object configured for activation commit with password and with biometry. -/// This variant of function allows you to use custom keys for biometry and possession factors. -/// -/// Function is not available for App extensions and on watchOS. -/// -/// @param password Password used for the knowledge factor. -/// @param customBiometryKey Custom key used for biometry factor. -/// @param customPossessionKey Custom key used for possession factor. -/// @return Instance of authentication object configured for activation commit with password and biometry, allowing to use custom keys for possession and biometry factors. -/// @deprecated Use `persistWithPasswordAndBiometry(password:customBiometryKey:customPossessionKey:)` as a replacement. -+ (nonnull PowerAuthAuthentication*) commitWithPasswordAndBiometry:(nonnull NSString*)password - customBiometryKey:(nullable NSData*)customBiometryKey - customPossessionKey:(nullable NSData*)customPossessionKey - NS_SWIFT_NAME(commitWithPasswordAndBiometry(password:customBiometryKey:customPossessionKey:)) - PA2_DEPRECATED(1.8.0); - // Signing, Possession only /// Create a new instance of authentication object preconfigured for signing with a possession factor. @@ -287,57 +232,6 @@ customPossessionKey:(nullable NSData*)customPossessionKey NS_SWIFT_NAME(persistWithPasswordAndBiometry(password:customBiometryKey:customPossessionKey:)); -// Deprecated commit - -/// Create a new instance of authentication object configured for activation commit with password. -/// -/// Function is not available for App extensions and on watchOS. -/// -/// @param password PowerAuthCorePassword used for the knowledge factor. -/// @return Instance of authentication object configured for activation commit with password. -+ (nonnull PowerAuthAuthentication*) commitWithCorePassword:(nonnull PowerAuthCorePassword*)password - NS_SWIFT_NAME(commitWithPassword(password:)) - PA2_DEPRECATED(1.8.0); - -/// Create a new instance of authentication object configured for activation commit with password and custom possession key. -/// -/// Function is not available for App extensions and on watchOS. -/// -/// @param password PowerAuthCorePassword used for the knowledge factor. -/// @param customPossessionKey Custom key used for possession factor. -/// @return Instance of authentication object configured for activation commit with password and custom possession key. -+ (nonnull PowerAuthAuthentication*) commitWithCorePassword:(nonnull PowerAuthCorePassword*)password - customPossessionKey:(nonnull NSData*)customPossessionKey - NS_SWIFT_NAME(commitWithPassword(password:customPossessionKey:)) - PA2_DEPRECATED(1.8.0); - -// Commit, Possession + Knowledge + Biometry - -/// Create a new instance of authentication object configured for activation commit with password and with biometry. -/// -/// Function is not available for App extensions and on watchOS. -/// -/// @param password PowerAuthCorePassword used for the knowledge factor. -/// @return Instance of authentication object configured for activation commit with password and biometry. -+ (nonnull PowerAuthAuthentication*) commitWithCorePasswordAndBiometry:(nonnull PowerAuthCorePassword*)password - NS_SWIFT_NAME(commitWithPasswordAndBiometry(password:)) - PA2_DEPRECATED(1.8.0); - -/// Create a new instance of authentication object configured for activation commit with password and with biometry. -/// This variant of function allows you to use custom keys for biometry and possession factors. -/// -/// Function is not available for App extensions and on watchOS. -/// -/// @param password PowerAuthCorePassword used for the knowledge factor. -/// @param customBiometryKey Custom key used for biometry factor. -/// @param customPossessionKey Custom key used for possession factor. -/// @return Instance of authentication object configured for activation commit with password and biometry, allowing to usecustom keys for possession and biometry factors. -+ (nonnull PowerAuthAuthentication*) commitWithCorePasswordAndBiometry:(nonnull PowerAuthCorePassword*)password - customBiometryKey:(nullable NSData*)customBiometryKey - customPossessionKey:(nullable NSData*)customPossessionKey - NS_SWIFT_NAME(commitWithPasswordAndBiometry(password:customBiometryKey:customPossessionKey:)) - PA2_DEPRECATED(1.8.0); - // Signing, Possession + Knowledge /// Create a new instance of authentication object preconfigured for combination of possesion and knowledge factors. diff --git a/proj-xcode/PowerAuth2/PowerAuthAuthentication.m b/proj-xcode/PowerAuth2/PowerAuthAuthentication.m index 6504c1aa..5fec30e0 100644 --- a/proj-xcode/PowerAuth2/PowerAuthAuthentication.m +++ b/proj-xcode/PowerAuth2/PowerAuthAuthentication.m @@ -157,19 +157,6 @@ + (PowerAuthAuthentication*) persistWithPasswordAndBiometry:(NSString*)password customPossessionKey:customPossessionKey]; } -// Commit - Deprecated - -+ (PowerAuthAuthentication*) commitWithPassword:(NSString*)password -{ - return [self persistWithPassword:password]; -} - -+ (PowerAuthAuthentication*) commitWithPassword:(NSString*)password - customPossessionKey:(NSData*)customPossessionKey -{ - return [self persistWithPassword:password customPossessionKey:customPossessionKey]; -} - // MARK: Commit, Possession + Knowledge + Biometry + (PowerAuthAuthentication*) commitWithPasswordAndBiometry:(NSString*)password @@ -351,31 +338,6 @@ + (PowerAuthAuthentication*) persistWithCorePasswordAndBiometry:(PowerAuthCorePa customBiometryKey:customBiometryKey]; } -// PA2_DEPRECATED(1.8.0) -+ (PowerAuthAuthentication*) commitWithCorePassword:(PowerAuthCorePassword*)password -{ - return [self persistWithCorePassword:password]; -} -// PA2_DEPRECATED(1.8.0) -+ (PowerAuthAuthentication*) commitWithCorePassword:(PowerAuthCorePassword*)password - customPossessionKey:(NSData*)customPossessionKey -{ - return [self persistWithCorePassword:password customPossessionKey:customPossessionKey]; -} -// PA2_DEPRECATED(1.8.0) -+ (PowerAuthAuthentication*) commitWithCorePasswordAndBiometry:(PowerAuthCorePassword*)password -{ - return [self persistWithCorePasswordAndBiometry:password]; -} -// PA2_DEPRECATED(1.8.0) -+ (PowerAuthAuthentication*) commitWithCorePasswordAndBiometry:(PowerAuthCorePassword*)password - customBiometryKey:(NSData*)customBiometryKey - customPossessionKey:(NSData*)customPossessionKey -{ - return [self persistWithCorePasswordAndBiometry:password customBiometryKey:customBiometryKey customPossessionKey:customPossessionKey]; -} - - + (PowerAuthAuthentication *) possessionWithCorePassword:(PowerAuthCorePassword*)password { return [[PowerAuthAuthentication alloc] initWithObjectUsage:AUTH_FOR_SIGN diff --git a/proj-xcode/PowerAuth2/PowerAuthSDK.h b/proj-xcode/PowerAuth2/PowerAuthSDK.h index f83f8d5c..a350451a 100644 --- a/proj-xcode/PowerAuth2/PowerAuthSDK.h +++ b/proj-xcode/PowerAuth2/PowerAuthSDK.h @@ -242,40 +242,6 @@ error:(NSError * _Nullable * _Nullable)error NS_SWIFT_NAME(persistActivation(withPassword:)); -/** - Persist activation that was created and store related data using provided authentication instance. - - @param authentication An authentication instance specifying what factors should be stored. - @param error Error reference in case some error occurs. - @exception NSException thrown in case configuration is not present. - @deprecated Use `persistActivation(with:)` method as a replacement. - */ -- (BOOL) commitActivationWithAuthentication:(nonnull PowerAuthAuthentication*)authentication - error:(NSError * _Nullable * _Nullable)error PA2_DEPRECATED(1.8.0); - -/** Persist activation that was created and store related data using default authentication instance setup with provided password. - - @param password Password to be used for the knowledge related authentication factor. - @param error Error reference in case some error occurs. - @exception NSException thrown in case configuration is not present. - @deprecated Use `persistActivation(withPassword:)` method as a replacement. - */ -- (BOOL) commitActivationWithPassword:(nonnull NSString*)password - error:(NSError * _Nullable * _Nullable)error - NS_SWIFT_NAME(commitActivation(withPassword:)) PA2_DEPRECATED(1.8.0); - -/** Persist activation that was created and store related data using default authentication instance setup with provided password. - - @param password Password to be used for the knowledge related authentication factor. - @param error Error reference in case some error occurs. - @exception NSException thrown in case configuration is not present. - @deprecated Use `persistActivation(withPassword:)` method as a replacement. - */ -- (BOOL) commitActivationWithCorePassword:(nonnull PowerAuthCorePassword*)password - error:(NSError * _Nullable * _Nullable)error - NS_SWIFT_NAME(commitActivation(withPassword:)) - PA2_DEPRECATED(1.8.0); - /** Read only property contains fingerprint calculated from device's public key or nil if object has no valid activation. */ diff --git a/proj-xcode/PowerAuth2/PowerAuthSDK.m b/proj-xcode/PowerAuth2/PowerAuthSDK.m index 801dcf77..b1a1c054 100644 --- a/proj-xcode/PowerAuth2/PowerAuthSDK.m +++ b/proj-xcode/PowerAuth2/PowerAuthSDK.m @@ -782,28 +782,6 @@ - (BOOL) persistActivationWithAuthentication:(PowerAuthAuthentication*)authentic return !reportedError; } -// PA2_DEPRECATED(1.8.0) -- (BOOL) commitActivationWithPassword:(NSString*)password - error:(NSError**)error -{ - return [self persistActivationWithPassword:password error:error]; -} - -// PA2_DEPRECATED(1.8.0) -- (BOOL) commitActivationWithCorePassword:(PowerAuthCorePassword *)password - error:(NSError **)error -{ - return [self persistActivationWithCorePassword:password error:error]; -} - -// PA2_DEPRECATED(1.8.0) -- (BOOL) commitActivationWithAuthentication:(PowerAuthAuthentication*)authentication - error:(NSError**)error -{ - return [self persistActivationWithAuthentication:authentication error:error]; -} - - - (NSString*) activationIdentifier { return _sessionInterface.activationIdentifier; From f94cd014148c11b8995de2ccd08102bc4346f9e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20=C4=8Eurech?= Date: Tue, 1 Oct 2024 10:24:38 +0200 Subject: [PATCH 2/3] Fix #630: Remove synchronous ECIES factory functions --- docs/Migration-from-1.8-to-1.9.md | 4 +- .../security/powerauth/sdk/PowerAuthSDK.java | 52 +------------------ proj-xcode/PowerAuth2/PowerAuthSDK.h | 28 ---------- proj-xcode/PowerAuth2/PowerAuthSDK.m | 12 ----- 4 files changed, 3 insertions(+), 93 deletions(-) diff --git a/docs/Migration-from-1.8-to-1.9.md b/docs/Migration-from-1.8-to-1.9.md index 9cdcd60b..0da4a102 100644 --- a/docs/Migration-from-1.8-to-1.9.md +++ b/docs/Migration-from-1.8-to-1.9.md @@ -16,7 +16,7 @@ PowerAuth Mobile SDK in version `1.9.0` provides the following improvements: ### API changes -- The following methods are now deprecated in the `PowerAuthSDK` class: +- The following methods are no longer available in the `PowerAuthSDK` class: - Synchronous method `getEciesEncryptorForApplicationScope()` is replaced with asynchronous variant that guarantees the temporary encryption key is prepared. - Synchronous method `getEciesEncryptorForActivationScope()` is replaced with asynchronous variant that guarantees the temporary encryption key is prepared. @@ -50,7 +50,7 @@ You can use new `EciesCryptogram.toEncryptedRequest()` method to convert cryptog ### API changes -- The following methods in `PowerAuthSDK` are now deprecated: +- The following methods are no longer available in `PowerAuthSDK` class: - Synchronous function `eciesEncryptorForApplicationScope()` is replaced with asynchronous variant that guarantees the temporary encryption key is prepared. - Synchronous function `eciesEncryptorForActivationScope()` is replaced with asynchronous variant that guarantees the temporary encryption key is prepared. diff --git a/proj-android/PowerAuthLibrary/src/main/java/io/getlime/security/powerauth/sdk/PowerAuthSDK.java b/proj-android/PowerAuthLibrary/src/main/java/io/getlime/security/powerauth/sdk/PowerAuthSDK.java index 44e812bf..0c194e0d 100644 --- a/proj-android/PowerAuthLibrary/src/main/java/io/getlime/security/powerauth/sdk/PowerAuthSDK.java +++ b/proj-android/PowerAuthLibrary/src/main/java/io/getlime/security/powerauth/sdk/PowerAuthSDK.java @@ -2411,57 +2411,7 @@ public void onCreateKeyFailed(@NonNull Throwable throwable) { } }); } - - /** - * Creates a new instance of ECIES encryptor suited for application's general end-to-end encryption purposes. - * The returned encryptor is cryptographically bound to the PowerAuth configuration, so it can be used - * with or without a valid activation. The encryptor also contains an associated {@link io.getlime.security.powerauth.ecies.EciesMetadata} - * object, allowing you to properly setup HTTP header for the request. - *

- * Note that this method is deprecated because doesn't guarantee that encryptor is provided, or the temporary encryption - * key is still valid. You should use new {@link #getEciesEncryptorForApplicationScope(IGetEciesEncryptorListener)} - * as a replacement. - * - * @return New instance of {@link EciesEncryptor} object with an associated {@link io.getlime.security.powerauth.ecies.EciesMetadata}. - * @throws PowerAuthErrorException if {@link PowerAuthConfiguration} contains an invalid configuration. - * You can call {@link PowerAuthErrorException#getPowerAuthErrorCode()} to get a more - * detailed information about the failure. - * @deprecated Use {@link #getEciesEncryptorForApplicationScope(IGetEciesEncryptorListener)} as a replacement. - */ - @Deprecated // 1.9.0 - public @Nullable EciesEncryptor getEciesEncryptorForApplicationScope() throws PowerAuthErrorException { - final IPrivateCryptoHelper helper = getCryptoHelper(null); - return helper.getEciesEncryptor(EciesEncryptorId.GENERIC_APPLICATION_SCOPE); - } - - /** - * Creates a new instance of ECIES encryptor suited for application's general end-to-end encryption purposes. - * The returned encryptor is cryptographically bound to a device's activation, so it can be used only - * when this instance has a valid activation. The encryptor also contains an associated {@link io.getlime.security.powerauth.ecies.EciesMetadata} - * object, allowing you to properly setup HTTP header for the request. - *

- * Note that the created encryptor has no reference to this instance of {@link PowerAuthSDK}. This means - * that if the instance will loose its activation in the future, then the encryptor will still be capable - * to encrypt, or decrypt the data. This is an expected behavior, so if you plan to keep the encryptor for - * multiple requests, then it's up to you to release its instance after you change the state of {@code PowerAuthSDK}. - *

- * Note that this method is deprecated because doesn't guarantee that encryptor is provided, or the temporary encryption - * key is still valid. You should use new {@link #getEciesEncryptorForActivationScope(Context, IGetEciesEncryptorListener)} - * as a replacement. - * - * @param context Android {@link Context} object - * @return New instance of {@link EciesEncryptor} object with an associated {@link io.getlime.security.powerauth.ecies.EciesMetadata}. - * @throws PowerAuthErrorException if {@link PowerAuthConfiguration} contains an invalid configuration or there's - * no activation. You can call {@link PowerAuthErrorException#getPowerAuthErrorCode()} to get a more - * detailed information about the failure. - * @deprecated Use {@link #getEciesEncryptorForActivationScope(Context, IGetEciesEncryptorListener)} as a replacement. - */ - @Deprecated // 1.9.0 - public @Nullable EciesEncryptor getEciesEncryptorForActivationScope(@NonNull final Context context) throws PowerAuthErrorException { - final IPrivateCryptoHelper helper = getCryptoHelper(context); - return helper.getEciesEncryptor(EciesEncryptorId.GENERIC_ACTIVATION_SCOPE); - } - + // Request synchronization /** diff --git a/proj-xcode/PowerAuth2/PowerAuthSDK.h b/proj-xcode/PowerAuth2/PowerAuthSDK.h index a350451a..9e509c28 100644 --- a/proj-xcode/PowerAuth2/PowerAuthSDK.h +++ b/proj-xcode/PowerAuth2/PowerAuthSDK.h @@ -579,34 +579,6 @@ */ - (nullable id) eciesEncryptorForActivationScopeWithCallback:(nonnull void(^)(PowerAuthCoreEciesEncryptor * _Nullable encryptor, NSError * _Nullable error))callback; -/** - Creates a new instance of ECIES encryptor suited for application's general end-to-end encryption purposes. The returned encryptor is - cryptographically bound to the PowerAuth configuration, so it can be used with or without a valid activation. The encryptor also contains - an associated `PowerAuthCoreEciesMetaData` object, allowing you to properly setup HTTP header for the request. - - Be aware that this method is deprecated because doesn't guarantee that encryptor is provided, or the temporary encryption - key is still valid. You should use the new asynchronous function as a replacement. - - @return New instance of `PowerAuthCoreEciesEncryptor` object or nil if `PowerAuthConfiguration` contains an invalid data. - */ -- (nullable PowerAuthCoreEciesEncryptor*) eciesEncryptorForApplicationScope PA2_DEPRECATED(1.9.0); - -/** - Creates a new instance of ECIES encryptor suited for application's general end-to-end encryption purposes. The returned encryptor is - cryptographically bound to a device's activation, so it can be used only when this instance has a valid activation. The encryptor also contains - an associated `PowerAuthCoreEciesMetaData` object, allowing you to properly setup HTTP header for the request. - - Note that the created encryptor has no reference to this instance of `PowerAuthSDK`. This means that if the `PowerAuthSDK` will loose its - activation in future, then the encryptor will still be capable to encrypt, or decrypt the data. This is an expected behavior, so if you - plan to keep the encryptor for multiple requests, then it's up to you to release its instance after you change the state of PowerAuthSDK. - - Be aware that this method is deprecated because doesn't guarantee that encryptor is provided, or the temporary encryption - key is still valid. You should use the new asynchronous function as a replacement. - - @return New instance of `PowerAuthCoreEciesEncryptor` object or nil if there's no valid activation. - */ -- (nullable PowerAuthCoreEciesEncryptor*) eciesEncryptorForActivationScope PA2_DEPRECATED(1.9.0); - @end // ----------------------------------------------------------------------- diff --git a/proj-xcode/PowerAuth2/PowerAuthSDK.m b/proj-xcode/PowerAuth2/PowerAuthSDK.m index b1a1c054..996d0074 100644 --- a/proj-xcode/PowerAuth2/PowerAuthSDK.m +++ b/proj-xcode/PowerAuth2/PowerAuthSDK.m @@ -1574,18 +1574,6 @@ - (PowerAuthCoreEciesEncryptor*) eciesEncryptorWithScope:(PowerAuthCoreEciesEncr } } -// PA2_DEPRECATED(1.9.0) -- (PowerAuthCoreEciesEncryptor*) eciesEncryptorForApplicationScope -{ - return [self eciesEncryptorWithScope:PowerAuthCoreEciesEncryptorScope_Application error:nil]; -} - -// PA2_DEPRECATED(1.9.0) -- (PowerAuthCoreEciesEncryptor*) eciesEncryptorForActivationScope -{ - return [self eciesEncryptorWithScope:PowerAuthCoreEciesEncryptorScope_Activation error:nil]; -} - @end From 1cbc0aa91bd20981c0e729e1cfd7ecd3c8627028 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juraj=20=C4=8Eurech?= Date: Tue, 1 Oct 2024 10:29:36 +0200 Subject: [PATCH 3/3] docs: Migration to 1.9.0 update --- docs/Migration-from-1.8-to-1.9.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Migration-from-1.8-to-1.9.md b/docs/Migration-from-1.8-to-1.9.md index 0da4a102..07be6678 100644 --- a/docs/Migration-from-1.8-to-1.9.md +++ b/docs/Migration-from-1.8-to-1.9.md @@ -50,7 +50,7 @@ You can use new `EciesCryptogram.toEncryptedRequest()` method to convert cryptog ### API changes -- The following methods are no longer available in `PowerAuthSDK` class: +- The following functions are no longer available in `PowerAuthSDK` class: - Synchronous function `eciesEncryptorForApplicationScope()` is replaced with asynchronous variant that guarantees the temporary encryption key is prepared. - Synchronous function `eciesEncryptorForActivationScope()` is replaced with asynchronous variant that guarantees the temporary encryption key is prepared.