v2 #12
							
								
								
									
										188
									
								
								packages/native_crypto_ios/ios/Classes/Public/messages.g.h
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										188
									
								
								packages/native_crypto_ios/ios/Classes/Public/messages.g.h
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,188 @@ | |||||||
|  | // Copyright 2019-2023 Hugo Pointcheval
 | ||||||
|  | // 
 | ||||||
|  | // Use of this source code is governed by an MIT-style
 | ||||||
|  | // license that can be found in the LICENSE file or at
 | ||||||
|  | // https://opensource.org/licenses/MIT.
 | ||||||
|  | // --
 | ||||||
|  | // Autogenerated from Pigeon (v9.0.0), do not edit directly.
 | ||||||
|  | // See also: https://pub.dev/packages/pigeon
 | ||||||
|  | 
 | ||||||
|  | #import <Foundation/Foundation.h> | ||||||
|  | 
 | ||||||
|  | @protocol FlutterBinaryMessenger; | ||||||
|  | @protocol FlutterMessageCodec; | ||||||
|  | @class FlutterError; | ||||||
|  | @class FlutterStandardTypedData; | ||||||
|  | 
 | ||||||
|  | NS_ASSUME_NONNULL_BEGIN | ||||||
|  | 
 | ||||||
|  | @class HashRequest; | ||||||
|  | @class HashResponse; | ||||||
|  | @class HmacRequest; | ||||||
|  | @class HmacResponse; | ||||||
|  | @class GenerateSecureRandomRequest; | ||||||
|  | @class GenerateSecureRandomResponse; | ||||||
|  | @class Pbkdf2Request; | ||||||
|  | @class Pbkdf2Response; | ||||||
|  | @class EncryptRequest; | ||||||
|  | @class EncryptResponse; | ||||||
|  | @class DecryptRequest; | ||||||
|  | @class DecryptResponse; | ||||||
|  | @class EncryptFileRequest; | ||||||
|  | @class EncryptFileResponse; | ||||||
|  | @class DecryptFileRequest; | ||||||
|  | @class DecryptFileResponse; | ||||||
|  | @class EncryptWithIVRequest; | ||||||
|  | 
 | ||||||
|  | @interface HashRequest : NSObject | ||||||
|  | + (instancetype)makeWithData:(nullable FlutterStandardTypedData *)data | ||||||
|  |     algorithm:(nullable NSString *)algorithm; | ||||||
|  | @property(nonatomic, strong, nullable) FlutterStandardTypedData * data; | ||||||
|  | @property(nonatomic, copy, nullable) NSString * algorithm; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface HashResponse : NSObject | ||||||
|  | + (instancetype)makeWithHash:(nullable FlutterStandardTypedData *)hash; | ||||||
|  | @property(nonatomic, strong, nullable) FlutterStandardTypedData * hash; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface HmacRequest : NSObject | ||||||
|  | + (instancetype)makeWithData:(nullable FlutterStandardTypedData *)data | ||||||
|  |     key:(nullable FlutterStandardTypedData *)key | ||||||
|  |     algorithm:(nullable NSString *)algorithm; | ||||||
|  | @property(nonatomic, strong, nullable) FlutterStandardTypedData * data; | ||||||
|  | @property(nonatomic, strong, nullable) FlutterStandardTypedData * key; | ||||||
|  | @property(nonatomic, copy, nullable) NSString * algorithm; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface HmacResponse : NSObject | ||||||
|  | + (instancetype)makeWithHmac:(nullable FlutterStandardTypedData *)hmac; | ||||||
|  | @property(nonatomic, strong, nullable) FlutterStandardTypedData * hmac; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface GenerateSecureRandomRequest : NSObject | ||||||
|  | + (instancetype)makeWithLength:(nullable NSNumber *)length; | ||||||
|  | @property(nonatomic, strong, nullable) NSNumber * length; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface GenerateSecureRandomResponse : NSObject | ||||||
|  | + (instancetype)makeWithRandom:(nullable FlutterStandardTypedData *)random; | ||||||
|  | @property(nonatomic, strong, nullable) FlutterStandardTypedData * random; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface Pbkdf2Request : NSObject | ||||||
|  | + (instancetype)makeWithPassword:(nullable FlutterStandardTypedData *)password | ||||||
|  |     salt:(nullable FlutterStandardTypedData *)salt | ||||||
|  |     length:(nullable NSNumber *)length | ||||||
|  |     iterations:(nullable NSNumber *)iterations | ||||||
|  |     hashAlgorithm:(nullable NSString *)hashAlgorithm; | ||||||
|  | @property(nonatomic, strong, nullable) FlutterStandardTypedData * password; | ||||||
|  | @property(nonatomic, strong, nullable) FlutterStandardTypedData * salt; | ||||||
|  | @property(nonatomic, strong, nullable) NSNumber * length; | ||||||
|  | @property(nonatomic, strong, nullable) NSNumber * iterations; | ||||||
|  | @property(nonatomic, copy, nullable) NSString * hashAlgorithm; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface Pbkdf2Response : NSObject | ||||||
|  | + (instancetype)makeWithKey:(nullable FlutterStandardTypedData *)key; | ||||||
|  | @property(nonatomic, strong, nullable) FlutterStandardTypedData * key; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface EncryptRequest : NSObject | ||||||
|  | + (instancetype)makeWithPlainText:(nullable FlutterStandardTypedData *)plainText | ||||||
|  |     key:(nullable FlutterStandardTypedData *)key | ||||||
|  |     algorithm:(nullable NSString *)algorithm; | ||||||
|  | @property(nonatomic, strong, nullable) FlutterStandardTypedData * plainText; | ||||||
|  | @property(nonatomic, strong, nullable) FlutterStandardTypedData * key; | ||||||
|  | @property(nonatomic, copy, nullable) NSString * algorithm; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface EncryptResponse : NSObject | ||||||
|  | + (instancetype)makeWithCipherText:(nullable FlutterStandardTypedData *)cipherText; | ||||||
|  | @property(nonatomic, strong, nullable) FlutterStandardTypedData * cipherText; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface DecryptRequest : NSObject | ||||||
|  | + (instancetype)makeWithCipherText:(nullable FlutterStandardTypedData *)cipherText | ||||||
|  |     key:(nullable FlutterStandardTypedData *)key | ||||||
|  |     algorithm:(nullable NSString *)algorithm; | ||||||
|  | @property(nonatomic, strong, nullable) FlutterStandardTypedData * cipherText; | ||||||
|  | @property(nonatomic, strong, nullable) FlutterStandardTypedData * key; | ||||||
|  | @property(nonatomic, copy, nullable) NSString * algorithm; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface DecryptResponse : NSObject | ||||||
|  | + (instancetype)makeWithPlainText:(nullable FlutterStandardTypedData *)plainText; | ||||||
|  | @property(nonatomic, strong, nullable) FlutterStandardTypedData * plainText; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface EncryptFileRequest : NSObject | ||||||
|  | + (instancetype)makeWithPlainTextPath:(nullable NSString *)plainTextPath | ||||||
|  |     cipherTextPath:(nullable NSString *)cipherTextPath | ||||||
|  |     key:(nullable FlutterStandardTypedData *)key | ||||||
|  |     algorithm:(nullable NSString *)algorithm; | ||||||
|  | @property(nonatomic, copy, nullable) NSString * plainTextPath; | ||||||
|  | @property(nonatomic, copy, nullable) NSString * cipherTextPath; | ||||||
|  | @property(nonatomic, strong, nullable) FlutterStandardTypedData * key; | ||||||
|  | @property(nonatomic, copy, nullable) NSString * algorithm; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface EncryptFileResponse : NSObject | ||||||
|  | + (instancetype)makeWithSuccess:(nullable NSNumber *)success; | ||||||
|  | @property(nonatomic, strong, nullable) NSNumber * success; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface DecryptFileRequest : NSObject | ||||||
|  | + (instancetype)makeWithCipherTextPath:(nullable NSString *)cipherTextPath | ||||||
|  |     plainTextPath:(nullable NSString *)plainTextPath | ||||||
|  |     key:(nullable FlutterStandardTypedData *)key | ||||||
|  |     algorithm:(nullable NSString *)algorithm; | ||||||
|  | @property(nonatomic, copy, nullable) NSString * cipherTextPath; | ||||||
|  | @property(nonatomic, copy, nullable) NSString * plainTextPath; | ||||||
|  | @property(nonatomic, strong, nullable) FlutterStandardTypedData * key; | ||||||
|  | @property(nonatomic, copy, nullable) NSString * algorithm; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface DecryptFileResponse : NSObject | ||||||
|  | + (instancetype)makeWithSuccess:(nullable NSNumber *)success; | ||||||
|  | @property(nonatomic, strong, nullable) NSNumber * success; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface EncryptWithIVRequest : NSObject | ||||||
|  | + (instancetype)makeWithPlainText:(nullable FlutterStandardTypedData *)plainText | ||||||
|  |     iv:(nullable FlutterStandardTypedData *)iv | ||||||
|  |     key:(nullable FlutterStandardTypedData *)key | ||||||
|  |     algorithm:(nullable NSString *)algorithm; | ||||||
|  | @property(nonatomic, strong, nullable) FlutterStandardTypedData * plainText; | ||||||
|  | @property(nonatomic, strong, nullable) FlutterStandardTypedData * iv; | ||||||
|  | @property(nonatomic, strong, nullable) FlutterStandardTypedData * key; | ||||||
|  | @property(nonatomic, copy, nullable) NSString * algorithm; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | /// The codec used by NativeCryptoAPI.
 | ||||||
|  | NSObject<FlutterMessageCodec> *NativeCryptoAPIGetCodec(void); | ||||||
|  | 
 | ||||||
|  | @protocol NativeCryptoAPI | ||||||
|  | /// @return `nil` only when `error != nil`.
 | ||||||
|  | - (nullable HashResponse *)hashRequest:(HashRequest *)request error:(FlutterError *_Nullable *_Nonnull)error; | ||||||
|  | /// @return `nil` only when `error != nil`.
 | ||||||
|  | - (nullable HmacResponse *)hmacRequest:(HmacRequest *)request error:(FlutterError *_Nullable *_Nonnull)error; | ||||||
|  | /// @return `nil` only when `error != nil`.
 | ||||||
|  | - (nullable GenerateSecureRandomResponse *)generateSecureRandomRequest:(GenerateSecureRandomRequest *)request error:(FlutterError *_Nullable *_Nonnull)error; | ||||||
|  | /// @return `nil` only when `error != nil`.
 | ||||||
|  | - (nullable Pbkdf2Response *)pbkdf2Request:(Pbkdf2Request *)request error:(FlutterError *_Nullable *_Nonnull)error; | ||||||
|  | /// @return `nil` only when `error != nil`.
 | ||||||
|  | - (nullable EncryptResponse *)encryptRequest:(EncryptRequest *)request error:(FlutterError *_Nullable *_Nonnull)error; | ||||||
|  | /// @return `nil` only when `error != nil`.
 | ||||||
|  | - (nullable DecryptResponse *)decryptRequest:(DecryptRequest *)request error:(FlutterError *_Nullable *_Nonnull)error; | ||||||
|  | /// @return `nil` only when `error != nil`.
 | ||||||
|  | - (nullable EncryptFileResponse *)encryptFileRequest:(EncryptFileRequest *)request error:(FlutterError *_Nullable *_Nonnull)error; | ||||||
|  | /// @return `nil` only when `error != nil`.
 | ||||||
|  | - (nullable DecryptFileResponse *)decryptFileRequest:(DecryptFileRequest *)request error:(FlutterError *_Nullable *_Nonnull)error; | ||||||
|  | /// @return `nil` only when `error != nil`.
 | ||||||
|  | - (nullable EncryptResponse *)encryptWithIVRequest:(EncryptWithIVRequest *)request error:(FlutterError *_Nullable *_Nonnull)error; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | extern void NativeCryptoAPISetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<NativeCryptoAPI> *_Nullable api); | ||||||
|  | 
 | ||||||
|  | NS_ASSUME_NONNULL_END | ||||||
							
								
								
									
										868
									
								
								packages/native_crypto_ios/ios/Classes/messages.g.m
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										868
									
								
								packages/native_crypto_ios/ios/Classes/messages.g.m
									
									
									
									
									
										Normal file
									
								
							| @ -0,0 +1,868 @@ | |||||||
|  | // Copyright 2019-2023 Hugo Pointcheval | ||||||
|  | //  | ||||||
|  | // Use of this source code is governed by an MIT-style | ||||||
|  | // license that can be found in the LICENSE file or at | ||||||
|  | // https://opensource.org/licenses/MIT. | ||||||
|  | // -- | ||||||
|  | // Autogenerated from Pigeon (v9.0.0), do not edit directly. | ||||||
|  | // See also: https://pub.dev/packages/pigeon | ||||||
|  | 
 | ||||||
|  | #import "messages.g.h" | ||||||
|  | #import <Flutter/Flutter.h> | ||||||
|  | 
 | ||||||
|  | #if !__has_feature(objc_arc) | ||||||
|  | #error File requires ARC to be enabled. | ||||||
|  | #endif | ||||||
|  | 
 | ||||||
|  | static NSArray *wrapResult(id result, FlutterError *error) { | ||||||
|  |   if (error) { | ||||||
|  |     return @[ | ||||||
|  |       error.code ?: [NSNull null], error.message ?: [NSNull null], error.details ?: [NSNull null] | ||||||
|  |     ]; | ||||||
|  |   } | ||||||
|  |   return @[ result ?: [NSNull null] ]; | ||||||
|  | } | ||||||
|  | static id GetNullableObjectAtIndex(NSArray *array, NSInteger key) { | ||||||
|  |   id result = array[key]; | ||||||
|  |   return (result == [NSNull null]) ? nil : result; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | @interface HashRequest () | ||||||
|  | + (HashRequest *)fromList:(NSArray *)list; | ||||||
|  | + (nullable HashRequest *)nullableFromList:(NSArray *)list; | ||||||
|  | - (NSArray *)toList; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface HashResponse () | ||||||
|  | + (HashResponse *)fromList:(NSArray *)list; | ||||||
|  | + (nullable HashResponse *)nullableFromList:(NSArray *)list; | ||||||
|  | - (NSArray *)toList; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface HmacRequest () | ||||||
|  | + (HmacRequest *)fromList:(NSArray *)list; | ||||||
|  | + (nullable HmacRequest *)nullableFromList:(NSArray *)list; | ||||||
|  | - (NSArray *)toList; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface HmacResponse () | ||||||
|  | + (HmacResponse *)fromList:(NSArray *)list; | ||||||
|  | + (nullable HmacResponse *)nullableFromList:(NSArray *)list; | ||||||
|  | - (NSArray *)toList; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface GenerateSecureRandomRequest () | ||||||
|  | + (GenerateSecureRandomRequest *)fromList:(NSArray *)list; | ||||||
|  | + (nullable GenerateSecureRandomRequest *)nullableFromList:(NSArray *)list; | ||||||
|  | - (NSArray *)toList; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface GenerateSecureRandomResponse () | ||||||
|  | + (GenerateSecureRandomResponse *)fromList:(NSArray *)list; | ||||||
|  | + (nullable GenerateSecureRandomResponse *)nullableFromList:(NSArray *)list; | ||||||
|  | - (NSArray *)toList; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface Pbkdf2Request () | ||||||
|  | + (Pbkdf2Request *)fromList:(NSArray *)list; | ||||||
|  | + (nullable Pbkdf2Request *)nullableFromList:(NSArray *)list; | ||||||
|  | - (NSArray *)toList; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface Pbkdf2Response () | ||||||
|  | + (Pbkdf2Response *)fromList:(NSArray *)list; | ||||||
|  | + (nullable Pbkdf2Response *)nullableFromList:(NSArray *)list; | ||||||
|  | - (NSArray *)toList; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface EncryptRequest () | ||||||
|  | + (EncryptRequest *)fromList:(NSArray *)list; | ||||||
|  | + (nullable EncryptRequest *)nullableFromList:(NSArray *)list; | ||||||
|  | - (NSArray *)toList; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface EncryptResponse () | ||||||
|  | + (EncryptResponse *)fromList:(NSArray *)list; | ||||||
|  | + (nullable EncryptResponse *)nullableFromList:(NSArray *)list; | ||||||
|  | - (NSArray *)toList; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface DecryptRequest () | ||||||
|  | + (DecryptRequest *)fromList:(NSArray *)list; | ||||||
|  | + (nullable DecryptRequest *)nullableFromList:(NSArray *)list; | ||||||
|  | - (NSArray *)toList; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface DecryptResponse () | ||||||
|  | + (DecryptResponse *)fromList:(NSArray *)list; | ||||||
|  | + (nullable DecryptResponse *)nullableFromList:(NSArray *)list; | ||||||
|  | - (NSArray *)toList; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface EncryptFileRequest () | ||||||
|  | + (EncryptFileRequest *)fromList:(NSArray *)list; | ||||||
|  | + (nullable EncryptFileRequest *)nullableFromList:(NSArray *)list; | ||||||
|  | - (NSArray *)toList; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface EncryptFileResponse () | ||||||
|  | + (EncryptFileResponse *)fromList:(NSArray *)list; | ||||||
|  | + (nullable EncryptFileResponse *)nullableFromList:(NSArray *)list; | ||||||
|  | - (NSArray *)toList; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface DecryptFileRequest () | ||||||
|  | + (DecryptFileRequest *)fromList:(NSArray *)list; | ||||||
|  | + (nullable DecryptFileRequest *)nullableFromList:(NSArray *)list; | ||||||
|  | - (NSArray *)toList; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface DecryptFileResponse () | ||||||
|  | + (DecryptFileResponse *)fromList:(NSArray *)list; | ||||||
|  | + (nullable DecryptFileResponse *)nullableFromList:(NSArray *)list; | ||||||
|  | - (NSArray *)toList; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface EncryptWithIVRequest () | ||||||
|  | + (EncryptWithIVRequest *)fromList:(NSArray *)list; | ||||||
|  | + (nullable EncryptWithIVRequest *)nullableFromList:(NSArray *)list; | ||||||
|  | - (NSArray *)toList; | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @implementation HashRequest | ||||||
|  | + (instancetype)makeWithData:(nullable FlutterStandardTypedData *)data | ||||||
|  |     algorithm:(nullable NSString *)algorithm { | ||||||
|  |   HashRequest* pigeonResult = [[HashRequest alloc] init]; | ||||||
|  |   pigeonResult.data = data; | ||||||
|  |   pigeonResult.algorithm = algorithm; | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (HashRequest *)fromList:(NSArray *)list { | ||||||
|  |   HashRequest *pigeonResult = [[HashRequest alloc] init]; | ||||||
|  |   pigeonResult.data = GetNullableObjectAtIndex(list, 0); | ||||||
|  |   pigeonResult.algorithm = GetNullableObjectAtIndex(list, 1); | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (nullable HashRequest *)nullableFromList:(NSArray *)list { | ||||||
|  |   return (list) ? [HashRequest fromList:list] : nil; | ||||||
|  | } | ||||||
|  | - (NSArray *)toList { | ||||||
|  |   return @[ | ||||||
|  |     (self.data ?: [NSNull null]), | ||||||
|  |     (self.algorithm ?: [NSNull null]), | ||||||
|  |   ]; | ||||||
|  | } | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @implementation HashResponse | ||||||
|  | + (instancetype)makeWithHash:(nullable FlutterStandardTypedData *)hash { | ||||||
|  |   HashResponse* pigeonResult = [[HashResponse alloc] init]; | ||||||
|  |   pigeonResult.hash = hash; | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (HashResponse *)fromList:(NSArray *)list { | ||||||
|  |   HashResponse *pigeonResult = [[HashResponse alloc] init]; | ||||||
|  |   pigeonResult.hash = GetNullableObjectAtIndex(list, 0); | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (nullable HashResponse *)nullableFromList:(NSArray *)list { | ||||||
|  |   return (list) ? [HashResponse fromList:list] : nil; | ||||||
|  | } | ||||||
|  | - (NSArray *)toList { | ||||||
|  |   return @[ | ||||||
|  |     (self.hash ?: [NSNull null]), | ||||||
|  |   ]; | ||||||
|  | } | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @implementation HmacRequest | ||||||
|  | + (instancetype)makeWithData:(nullable FlutterStandardTypedData *)data | ||||||
|  |     key:(nullable FlutterStandardTypedData *)key | ||||||
|  |     algorithm:(nullable NSString *)algorithm { | ||||||
|  |   HmacRequest* pigeonResult = [[HmacRequest alloc] init]; | ||||||
|  |   pigeonResult.data = data; | ||||||
|  |   pigeonResult.key = key; | ||||||
|  |   pigeonResult.algorithm = algorithm; | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (HmacRequest *)fromList:(NSArray *)list { | ||||||
|  |   HmacRequest *pigeonResult = [[HmacRequest alloc] init]; | ||||||
|  |   pigeonResult.data = GetNullableObjectAtIndex(list, 0); | ||||||
|  |   pigeonResult.key = GetNullableObjectAtIndex(list, 1); | ||||||
|  |   pigeonResult.algorithm = GetNullableObjectAtIndex(list, 2); | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (nullable HmacRequest *)nullableFromList:(NSArray *)list { | ||||||
|  |   return (list) ? [HmacRequest fromList:list] : nil; | ||||||
|  | } | ||||||
|  | - (NSArray *)toList { | ||||||
|  |   return @[ | ||||||
|  |     (self.data ?: [NSNull null]), | ||||||
|  |     (self.key ?: [NSNull null]), | ||||||
|  |     (self.algorithm ?: [NSNull null]), | ||||||
|  |   ]; | ||||||
|  | } | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @implementation HmacResponse | ||||||
|  | + (instancetype)makeWithHmac:(nullable FlutterStandardTypedData *)hmac { | ||||||
|  |   HmacResponse* pigeonResult = [[HmacResponse alloc] init]; | ||||||
|  |   pigeonResult.hmac = hmac; | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (HmacResponse *)fromList:(NSArray *)list { | ||||||
|  |   HmacResponse *pigeonResult = [[HmacResponse alloc] init]; | ||||||
|  |   pigeonResult.hmac = GetNullableObjectAtIndex(list, 0); | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (nullable HmacResponse *)nullableFromList:(NSArray *)list { | ||||||
|  |   return (list) ? [HmacResponse fromList:list] : nil; | ||||||
|  | } | ||||||
|  | - (NSArray *)toList { | ||||||
|  |   return @[ | ||||||
|  |     (self.hmac ?: [NSNull null]), | ||||||
|  |   ]; | ||||||
|  | } | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @implementation GenerateSecureRandomRequest | ||||||
|  | + (instancetype)makeWithLength:(nullable NSNumber *)length { | ||||||
|  |   GenerateSecureRandomRequest* pigeonResult = [[GenerateSecureRandomRequest alloc] init]; | ||||||
|  |   pigeonResult.length = length; | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (GenerateSecureRandomRequest *)fromList:(NSArray *)list { | ||||||
|  |   GenerateSecureRandomRequest *pigeonResult = [[GenerateSecureRandomRequest alloc] init]; | ||||||
|  |   pigeonResult.length = GetNullableObjectAtIndex(list, 0); | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (nullable GenerateSecureRandomRequest *)nullableFromList:(NSArray *)list { | ||||||
|  |   return (list) ? [GenerateSecureRandomRequest fromList:list] : nil; | ||||||
|  | } | ||||||
|  | - (NSArray *)toList { | ||||||
|  |   return @[ | ||||||
|  |     (self.length ?: [NSNull null]), | ||||||
|  |   ]; | ||||||
|  | } | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @implementation GenerateSecureRandomResponse | ||||||
|  | + (instancetype)makeWithRandom:(nullable FlutterStandardTypedData *)random { | ||||||
|  |   GenerateSecureRandomResponse* pigeonResult = [[GenerateSecureRandomResponse alloc] init]; | ||||||
|  |   pigeonResult.random = random; | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (GenerateSecureRandomResponse *)fromList:(NSArray *)list { | ||||||
|  |   GenerateSecureRandomResponse *pigeonResult = [[GenerateSecureRandomResponse alloc] init]; | ||||||
|  |   pigeonResult.random = GetNullableObjectAtIndex(list, 0); | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (nullable GenerateSecureRandomResponse *)nullableFromList:(NSArray *)list { | ||||||
|  |   return (list) ? [GenerateSecureRandomResponse fromList:list] : nil; | ||||||
|  | } | ||||||
|  | - (NSArray *)toList { | ||||||
|  |   return @[ | ||||||
|  |     (self.random ?: [NSNull null]), | ||||||
|  |   ]; | ||||||
|  | } | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @implementation Pbkdf2Request | ||||||
|  | + (instancetype)makeWithPassword:(nullable FlutterStandardTypedData *)password | ||||||
|  |     salt:(nullable FlutterStandardTypedData *)salt | ||||||
|  |     length:(nullable NSNumber *)length | ||||||
|  |     iterations:(nullable NSNumber *)iterations | ||||||
|  |     hashAlgorithm:(nullable NSString *)hashAlgorithm { | ||||||
|  |   Pbkdf2Request* pigeonResult = [[Pbkdf2Request alloc] init]; | ||||||
|  |   pigeonResult.password = password; | ||||||
|  |   pigeonResult.salt = salt; | ||||||
|  |   pigeonResult.length = length; | ||||||
|  |   pigeonResult.iterations = iterations; | ||||||
|  |   pigeonResult.hashAlgorithm = hashAlgorithm; | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (Pbkdf2Request *)fromList:(NSArray *)list { | ||||||
|  |   Pbkdf2Request *pigeonResult = [[Pbkdf2Request alloc] init]; | ||||||
|  |   pigeonResult.password = GetNullableObjectAtIndex(list, 0); | ||||||
|  |   pigeonResult.salt = GetNullableObjectAtIndex(list, 1); | ||||||
|  |   pigeonResult.length = GetNullableObjectAtIndex(list, 2); | ||||||
|  |   pigeonResult.iterations = GetNullableObjectAtIndex(list, 3); | ||||||
|  |   pigeonResult.hashAlgorithm = GetNullableObjectAtIndex(list, 4); | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (nullable Pbkdf2Request *)nullableFromList:(NSArray *)list { | ||||||
|  |   return (list) ? [Pbkdf2Request fromList:list] : nil; | ||||||
|  | } | ||||||
|  | - (NSArray *)toList { | ||||||
|  |   return @[ | ||||||
|  |     (self.password ?: [NSNull null]), | ||||||
|  |     (self.salt ?: [NSNull null]), | ||||||
|  |     (self.length ?: [NSNull null]), | ||||||
|  |     (self.iterations ?: [NSNull null]), | ||||||
|  |     (self.hashAlgorithm ?: [NSNull null]), | ||||||
|  |   ]; | ||||||
|  | } | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @implementation Pbkdf2Response | ||||||
|  | + (instancetype)makeWithKey:(nullable FlutterStandardTypedData *)key { | ||||||
|  |   Pbkdf2Response* pigeonResult = [[Pbkdf2Response alloc] init]; | ||||||
|  |   pigeonResult.key = key; | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (Pbkdf2Response *)fromList:(NSArray *)list { | ||||||
|  |   Pbkdf2Response *pigeonResult = [[Pbkdf2Response alloc] init]; | ||||||
|  |   pigeonResult.key = GetNullableObjectAtIndex(list, 0); | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (nullable Pbkdf2Response *)nullableFromList:(NSArray *)list { | ||||||
|  |   return (list) ? [Pbkdf2Response fromList:list] : nil; | ||||||
|  | } | ||||||
|  | - (NSArray *)toList { | ||||||
|  |   return @[ | ||||||
|  |     (self.key ?: [NSNull null]), | ||||||
|  |   ]; | ||||||
|  | } | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @implementation EncryptRequest | ||||||
|  | + (instancetype)makeWithPlainText:(nullable FlutterStandardTypedData *)plainText | ||||||
|  |     key:(nullable FlutterStandardTypedData *)key | ||||||
|  |     algorithm:(nullable NSString *)algorithm { | ||||||
|  |   EncryptRequest* pigeonResult = [[EncryptRequest alloc] init]; | ||||||
|  |   pigeonResult.plainText = plainText; | ||||||
|  |   pigeonResult.key = key; | ||||||
|  |   pigeonResult.algorithm = algorithm; | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (EncryptRequest *)fromList:(NSArray *)list { | ||||||
|  |   EncryptRequest *pigeonResult = [[EncryptRequest alloc] init]; | ||||||
|  |   pigeonResult.plainText = GetNullableObjectAtIndex(list, 0); | ||||||
|  |   pigeonResult.key = GetNullableObjectAtIndex(list, 1); | ||||||
|  |   pigeonResult.algorithm = GetNullableObjectAtIndex(list, 2); | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (nullable EncryptRequest *)nullableFromList:(NSArray *)list { | ||||||
|  |   return (list) ? [EncryptRequest fromList:list] : nil; | ||||||
|  | } | ||||||
|  | - (NSArray *)toList { | ||||||
|  |   return @[ | ||||||
|  |     (self.plainText ?: [NSNull null]), | ||||||
|  |     (self.key ?: [NSNull null]), | ||||||
|  |     (self.algorithm ?: [NSNull null]), | ||||||
|  |   ]; | ||||||
|  | } | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @implementation EncryptResponse | ||||||
|  | + (instancetype)makeWithCipherText:(nullable FlutterStandardTypedData *)cipherText { | ||||||
|  |   EncryptResponse* pigeonResult = [[EncryptResponse alloc] init]; | ||||||
|  |   pigeonResult.cipherText = cipherText; | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (EncryptResponse *)fromList:(NSArray *)list { | ||||||
|  |   EncryptResponse *pigeonResult = [[EncryptResponse alloc] init]; | ||||||
|  |   pigeonResult.cipherText = GetNullableObjectAtIndex(list, 0); | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (nullable EncryptResponse *)nullableFromList:(NSArray *)list { | ||||||
|  |   return (list) ? [EncryptResponse fromList:list] : nil; | ||||||
|  | } | ||||||
|  | - (NSArray *)toList { | ||||||
|  |   return @[ | ||||||
|  |     (self.cipherText ?: [NSNull null]), | ||||||
|  |   ]; | ||||||
|  | } | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @implementation DecryptRequest | ||||||
|  | + (instancetype)makeWithCipherText:(nullable FlutterStandardTypedData *)cipherText | ||||||
|  |     key:(nullable FlutterStandardTypedData *)key | ||||||
|  |     algorithm:(nullable NSString *)algorithm { | ||||||
|  |   DecryptRequest* pigeonResult = [[DecryptRequest alloc] init]; | ||||||
|  |   pigeonResult.cipherText = cipherText; | ||||||
|  |   pigeonResult.key = key; | ||||||
|  |   pigeonResult.algorithm = algorithm; | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (DecryptRequest *)fromList:(NSArray *)list { | ||||||
|  |   DecryptRequest *pigeonResult = [[DecryptRequest alloc] init]; | ||||||
|  |   pigeonResult.cipherText = GetNullableObjectAtIndex(list, 0); | ||||||
|  |   pigeonResult.key = GetNullableObjectAtIndex(list, 1); | ||||||
|  |   pigeonResult.algorithm = GetNullableObjectAtIndex(list, 2); | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (nullable DecryptRequest *)nullableFromList:(NSArray *)list { | ||||||
|  |   return (list) ? [DecryptRequest fromList:list] : nil; | ||||||
|  | } | ||||||
|  | - (NSArray *)toList { | ||||||
|  |   return @[ | ||||||
|  |     (self.cipherText ?: [NSNull null]), | ||||||
|  |     (self.key ?: [NSNull null]), | ||||||
|  |     (self.algorithm ?: [NSNull null]), | ||||||
|  |   ]; | ||||||
|  | } | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @implementation DecryptResponse | ||||||
|  | + (instancetype)makeWithPlainText:(nullable FlutterStandardTypedData *)plainText { | ||||||
|  |   DecryptResponse* pigeonResult = [[DecryptResponse alloc] init]; | ||||||
|  |   pigeonResult.plainText = plainText; | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (DecryptResponse *)fromList:(NSArray *)list { | ||||||
|  |   DecryptResponse *pigeonResult = [[DecryptResponse alloc] init]; | ||||||
|  |   pigeonResult.plainText = GetNullableObjectAtIndex(list, 0); | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (nullable DecryptResponse *)nullableFromList:(NSArray *)list { | ||||||
|  |   return (list) ? [DecryptResponse fromList:list] : nil; | ||||||
|  | } | ||||||
|  | - (NSArray *)toList { | ||||||
|  |   return @[ | ||||||
|  |     (self.plainText ?: [NSNull null]), | ||||||
|  |   ]; | ||||||
|  | } | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @implementation EncryptFileRequest | ||||||
|  | + (instancetype)makeWithPlainTextPath:(nullable NSString *)plainTextPath | ||||||
|  |     cipherTextPath:(nullable NSString *)cipherTextPath | ||||||
|  |     key:(nullable FlutterStandardTypedData *)key | ||||||
|  |     algorithm:(nullable NSString *)algorithm { | ||||||
|  |   EncryptFileRequest* pigeonResult = [[EncryptFileRequest alloc] init]; | ||||||
|  |   pigeonResult.plainTextPath = plainTextPath; | ||||||
|  |   pigeonResult.cipherTextPath = cipherTextPath; | ||||||
|  |   pigeonResult.key = key; | ||||||
|  |   pigeonResult.algorithm = algorithm; | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (EncryptFileRequest *)fromList:(NSArray *)list { | ||||||
|  |   EncryptFileRequest *pigeonResult = [[EncryptFileRequest alloc] init]; | ||||||
|  |   pigeonResult.plainTextPath = GetNullableObjectAtIndex(list, 0); | ||||||
|  |   pigeonResult.cipherTextPath = GetNullableObjectAtIndex(list, 1); | ||||||
|  |   pigeonResult.key = GetNullableObjectAtIndex(list, 2); | ||||||
|  |   pigeonResult.algorithm = GetNullableObjectAtIndex(list, 3); | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (nullable EncryptFileRequest *)nullableFromList:(NSArray *)list { | ||||||
|  |   return (list) ? [EncryptFileRequest fromList:list] : nil; | ||||||
|  | } | ||||||
|  | - (NSArray *)toList { | ||||||
|  |   return @[ | ||||||
|  |     (self.plainTextPath ?: [NSNull null]), | ||||||
|  |     (self.cipherTextPath ?: [NSNull null]), | ||||||
|  |     (self.key ?: [NSNull null]), | ||||||
|  |     (self.algorithm ?: [NSNull null]), | ||||||
|  |   ]; | ||||||
|  | } | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @implementation EncryptFileResponse | ||||||
|  | + (instancetype)makeWithSuccess:(nullable NSNumber *)success { | ||||||
|  |   EncryptFileResponse* pigeonResult = [[EncryptFileResponse alloc] init]; | ||||||
|  |   pigeonResult.success = success; | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (EncryptFileResponse *)fromList:(NSArray *)list { | ||||||
|  |   EncryptFileResponse *pigeonResult = [[EncryptFileResponse alloc] init]; | ||||||
|  |   pigeonResult.success = GetNullableObjectAtIndex(list, 0); | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (nullable EncryptFileResponse *)nullableFromList:(NSArray *)list { | ||||||
|  |   return (list) ? [EncryptFileResponse fromList:list] : nil; | ||||||
|  | } | ||||||
|  | - (NSArray *)toList { | ||||||
|  |   return @[ | ||||||
|  |     (self.success ?: [NSNull null]), | ||||||
|  |   ]; | ||||||
|  | } | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @implementation DecryptFileRequest | ||||||
|  | + (instancetype)makeWithCipherTextPath:(nullable NSString *)cipherTextPath | ||||||
|  |     plainTextPath:(nullable NSString *)plainTextPath | ||||||
|  |     key:(nullable FlutterStandardTypedData *)key | ||||||
|  |     algorithm:(nullable NSString *)algorithm { | ||||||
|  |   DecryptFileRequest* pigeonResult = [[DecryptFileRequest alloc] init]; | ||||||
|  |   pigeonResult.cipherTextPath = cipherTextPath; | ||||||
|  |   pigeonResult.plainTextPath = plainTextPath; | ||||||
|  |   pigeonResult.key = key; | ||||||
|  |   pigeonResult.algorithm = algorithm; | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (DecryptFileRequest *)fromList:(NSArray *)list { | ||||||
|  |   DecryptFileRequest *pigeonResult = [[DecryptFileRequest alloc] init]; | ||||||
|  |   pigeonResult.cipherTextPath = GetNullableObjectAtIndex(list, 0); | ||||||
|  |   pigeonResult.plainTextPath = GetNullableObjectAtIndex(list, 1); | ||||||
|  |   pigeonResult.key = GetNullableObjectAtIndex(list, 2); | ||||||
|  |   pigeonResult.algorithm = GetNullableObjectAtIndex(list, 3); | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (nullable DecryptFileRequest *)nullableFromList:(NSArray *)list { | ||||||
|  |   return (list) ? [DecryptFileRequest fromList:list] : nil; | ||||||
|  | } | ||||||
|  | - (NSArray *)toList { | ||||||
|  |   return @[ | ||||||
|  |     (self.cipherTextPath ?: [NSNull null]), | ||||||
|  |     (self.plainTextPath ?: [NSNull null]), | ||||||
|  |     (self.key ?: [NSNull null]), | ||||||
|  |     (self.algorithm ?: [NSNull null]), | ||||||
|  |   ]; | ||||||
|  | } | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @implementation DecryptFileResponse | ||||||
|  | + (instancetype)makeWithSuccess:(nullable NSNumber *)success { | ||||||
|  |   DecryptFileResponse* pigeonResult = [[DecryptFileResponse alloc] init]; | ||||||
|  |   pigeonResult.success = success; | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (DecryptFileResponse *)fromList:(NSArray *)list { | ||||||
|  |   DecryptFileResponse *pigeonResult = [[DecryptFileResponse alloc] init]; | ||||||
|  |   pigeonResult.success = GetNullableObjectAtIndex(list, 0); | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (nullable DecryptFileResponse *)nullableFromList:(NSArray *)list { | ||||||
|  |   return (list) ? [DecryptFileResponse fromList:list] : nil; | ||||||
|  | } | ||||||
|  | - (NSArray *)toList { | ||||||
|  |   return @[ | ||||||
|  |     (self.success ?: [NSNull null]), | ||||||
|  |   ]; | ||||||
|  | } | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @implementation EncryptWithIVRequest | ||||||
|  | + (instancetype)makeWithPlainText:(nullable FlutterStandardTypedData *)plainText | ||||||
|  |     iv:(nullable FlutterStandardTypedData *)iv | ||||||
|  |     key:(nullable FlutterStandardTypedData *)key | ||||||
|  |     algorithm:(nullable NSString *)algorithm { | ||||||
|  |   EncryptWithIVRequest* pigeonResult = [[EncryptWithIVRequest alloc] init]; | ||||||
|  |   pigeonResult.plainText = plainText; | ||||||
|  |   pigeonResult.iv = iv; | ||||||
|  |   pigeonResult.key = key; | ||||||
|  |   pigeonResult.algorithm = algorithm; | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (EncryptWithIVRequest *)fromList:(NSArray *)list { | ||||||
|  |   EncryptWithIVRequest *pigeonResult = [[EncryptWithIVRequest alloc] init]; | ||||||
|  |   pigeonResult.plainText = GetNullableObjectAtIndex(list, 0); | ||||||
|  |   pigeonResult.iv = GetNullableObjectAtIndex(list, 1); | ||||||
|  |   pigeonResult.key = GetNullableObjectAtIndex(list, 2); | ||||||
|  |   pigeonResult.algorithm = GetNullableObjectAtIndex(list, 3); | ||||||
|  |   return pigeonResult; | ||||||
|  | } | ||||||
|  | + (nullable EncryptWithIVRequest *)nullableFromList:(NSArray *)list { | ||||||
|  |   return (list) ? [EncryptWithIVRequest fromList:list] : nil; | ||||||
|  | } | ||||||
|  | - (NSArray *)toList { | ||||||
|  |   return @[ | ||||||
|  |     (self.plainText ?: [NSNull null]), | ||||||
|  |     (self.iv ?: [NSNull null]), | ||||||
|  |     (self.key ?: [NSNull null]), | ||||||
|  |     (self.algorithm ?: [NSNull null]), | ||||||
|  |   ]; | ||||||
|  | } | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface NativeCryptoAPICodecReader : FlutterStandardReader | ||||||
|  | @end | ||||||
|  | @implementation NativeCryptoAPICodecReader | ||||||
|  | - (nullable id)readValueOfType:(UInt8)type { | ||||||
|  |   switch (type) { | ||||||
|  |     case 128:  | ||||||
|  |       return [DecryptFileRequest fromList:[self readValue]]; | ||||||
|  |     case 129:  | ||||||
|  |       return [DecryptFileResponse fromList:[self readValue]]; | ||||||
|  |     case 130:  | ||||||
|  |       return [DecryptRequest fromList:[self readValue]]; | ||||||
|  |     case 131:  | ||||||
|  |       return [DecryptResponse fromList:[self readValue]]; | ||||||
|  |     case 132:  | ||||||
|  |       return [EncryptFileRequest fromList:[self readValue]]; | ||||||
|  |     case 133:  | ||||||
|  |       return [EncryptFileResponse fromList:[self readValue]]; | ||||||
|  |     case 134:  | ||||||
|  |       return [EncryptRequest fromList:[self readValue]]; | ||||||
|  |     case 135:  | ||||||
|  |       return [EncryptResponse fromList:[self readValue]]; | ||||||
|  |     case 136:  | ||||||
|  |       return [EncryptWithIVRequest fromList:[self readValue]]; | ||||||
|  |     case 137:  | ||||||
|  |       return [GenerateSecureRandomRequest fromList:[self readValue]]; | ||||||
|  |     case 138:  | ||||||
|  |       return [GenerateSecureRandomResponse fromList:[self readValue]]; | ||||||
|  |     case 139:  | ||||||
|  |       return [HashRequest fromList:[self readValue]]; | ||||||
|  |     case 140:  | ||||||
|  |       return [HashResponse fromList:[self readValue]]; | ||||||
|  |     case 141:  | ||||||
|  |       return [HmacRequest fromList:[self readValue]]; | ||||||
|  |     case 142:  | ||||||
|  |       return [HmacResponse fromList:[self readValue]]; | ||||||
|  |     case 143:  | ||||||
|  |       return [Pbkdf2Request fromList:[self readValue]]; | ||||||
|  |     case 144:  | ||||||
|  |       return [Pbkdf2Response fromList:[self readValue]]; | ||||||
|  |     default: | ||||||
|  |       return [super readValueOfType:type]; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface NativeCryptoAPICodecWriter : FlutterStandardWriter | ||||||
|  | @end | ||||||
|  | @implementation NativeCryptoAPICodecWriter | ||||||
|  | - (void)writeValue:(id)value { | ||||||
|  |   if ([value isKindOfClass:[DecryptFileRequest class]]) { | ||||||
|  |     [self writeByte:128]; | ||||||
|  |     [self writeValue:[value toList]]; | ||||||
|  |   } else if ([value isKindOfClass:[DecryptFileResponse class]]) { | ||||||
|  |     [self writeByte:129]; | ||||||
|  |     [self writeValue:[value toList]]; | ||||||
|  |   } else if ([value isKindOfClass:[DecryptRequest class]]) { | ||||||
|  |     [self writeByte:130]; | ||||||
|  |     [self writeValue:[value toList]]; | ||||||
|  |   } else if ([value isKindOfClass:[DecryptResponse class]]) { | ||||||
|  |     [self writeByte:131]; | ||||||
|  |     [self writeValue:[value toList]]; | ||||||
|  |   } else if ([value isKindOfClass:[EncryptFileRequest class]]) { | ||||||
|  |     [self writeByte:132]; | ||||||
|  |     [self writeValue:[value toList]]; | ||||||
|  |   } else if ([value isKindOfClass:[EncryptFileResponse class]]) { | ||||||
|  |     [self writeByte:133]; | ||||||
|  |     [self writeValue:[value toList]]; | ||||||
|  |   } else if ([value isKindOfClass:[EncryptRequest class]]) { | ||||||
|  |     [self writeByte:134]; | ||||||
|  |     [self writeValue:[value toList]]; | ||||||
|  |   } else if ([value isKindOfClass:[EncryptResponse class]]) { | ||||||
|  |     [self writeByte:135]; | ||||||
|  |     [self writeValue:[value toList]]; | ||||||
|  |   } else if ([value isKindOfClass:[EncryptWithIVRequest class]]) { | ||||||
|  |     [self writeByte:136]; | ||||||
|  |     [self writeValue:[value toList]]; | ||||||
|  |   } else if ([value isKindOfClass:[GenerateSecureRandomRequest class]]) { | ||||||
|  |     [self writeByte:137]; | ||||||
|  |     [self writeValue:[value toList]]; | ||||||
|  |   } else if ([value isKindOfClass:[GenerateSecureRandomResponse class]]) { | ||||||
|  |     [self writeByte:138]; | ||||||
|  |     [self writeValue:[value toList]]; | ||||||
|  |   } else if ([value isKindOfClass:[HashRequest class]]) { | ||||||
|  |     [self writeByte:139]; | ||||||
|  |     [self writeValue:[value toList]]; | ||||||
|  |   } else if ([value isKindOfClass:[HashResponse class]]) { | ||||||
|  |     [self writeByte:140]; | ||||||
|  |     [self writeValue:[value toList]]; | ||||||
|  |   } else if ([value isKindOfClass:[HmacRequest class]]) { | ||||||
|  |     [self writeByte:141]; | ||||||
|  |     [self writeValue:[value toList]]; | ||||||
|  |   } else if ([value isKindOfClass:[HmacResponse class]]) { | ||||||
|  |     [self writeByte:142]; | ||||||
|  |     [self writeValue:[value toList]]; | ||||||
|  |   } else if ([value isKindOfClass:[Pbkdf2Request class]]) { | ||||||
|  |     [self writeByte:143]; | ||||||
|  |     [self writeValue:[value toList]]; | ||||||
|  |   } else if ([value isKindOfClass:[Pbkdf2Response class]]) { | ||||||
|  |     [self writeByte:144]; | ||||||
|  |     [self writeValue:[value toList]]; | ||||||
|  |   } else { | ||||||
|  |     [super writeValue:value]; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | @interface NativeCryptoAPICodecReaderWriter : FlutterStandardReaderWriter | ||||||
|  | @end | ||||||
|  | @implementation NativeCryptoAPICodecReaderWriter | ||||||
|  | - (FlutterStandardWriter *)writerWithData:(NSMutableData *)data { | ||||||
|  |   return [[NativeCryptoAPICodecWriter alloc] initWithData:data]; | ||||||
|  | } | ||||||
|  | - (FlutterStandardReader *)readerWithData:(NSData *)data { | ||||||
|  |   return [[NativeCryptoAPICodecReader alloc] initWithData:data]; | ||||||
|  | } | ||||||
|  | @end | ||||||
|  | 
 | ||||||
|  | NSObject<FlutterMessageCodec> *NativeCryptoAPIGetCodec() { | ||||||
|  |   static FlutterStandardMessageCodec *sSharedObject = nil; | ||||||
|  |   static dispatch_once_t sPred = 0; | ||||||
|  |   dispatch_once(&sPred, ^{ | ||||||
|  |     NativeCryptoAPICodecReaderWriter *readerWriter = [[NativeCryptoAPICodecReaderWriter alloc] init]; | ||||||
|  |     sSharedObject = [FlutterStandardMessageCodec codecWithReaderWriter:readerWriter]; | ||||||
|  |   }); | ||||||
|  |   return sSharedObject; | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | void NativeCryptoAPISetup(id<FlutterBinaryMessenger> binaryMessenger, NSObject<NativeCryptoAPI> *api) { | ||||||
|  |   { | ||||||
|  |     FlutterBasicMessageChannel *channel = | ||||||
|  |       [[FlutterBasicMessageChannel alloc] | ||||||
|  |         initWithName:@"dev.flutter.pigeon.NativeCryptoAPI.hash" | ||||||
|  |         binaryMessenger:binaryMessenger | ||||||
|  |         codec:NativeCryptoAPIGetCodec()]; | ||||||
|  |     if (api) { | ||||||
|  |       NSCAssert([api respondsToSelector:@selector(hashRequest:error:)], @"NativeCryptoAPI api (%@) doesn't respond to @selector(hashRequest:error:)", api); | ||||||
|  |       [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { | ||||||
|  |         NSArray *args = message; | ||||||
|  |         HashRequest *arg_request = GetNullableObjectAtIndex(args, 0); | ||||||
|  |         FlutterError *error; | ||||||
|  |         HashResponse *output = [api hashRequest:arg_request error:&error]; | ||||||
|  |         callback(wrapResult(output, error)); | ||||||
|  |       }]; | ||||||
|  |     } else { | ||||||
|  |       [channel setMessageHandler:nil]; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |   { | ||||||
|  |     FlutterBasicMessageChannel *channel = | ||||||
|  |       [[FlutterBasicMessageChannel alloc] | ||||||
|  |         initWithName:@"dev.flutter.pigeon.NativeCryptoAPI.hmac" | ||||||
|  |         binaryMessenger:binaryMessenger | ||||||
|  |         codec:NativeCryptoAPIGetCodec()]; | ||||||
|  |     if (api) { | ||||||
|  |       NSCAssert([api respondsToSelector:@selector(hmacRequest:error:)], @"NativeCryptoAPI api (%@) doesn't respond to @selector(hmacRequest:error:)", api); | ||||||
|  |       [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { | ||||||
|  |         NSArray *args = message; | ||||||
|  |         HmacRequest *arg_request = GetNullableObjectAtIndex(args, 0); | ||||||
|  |         FlutterError *error; | ||||||
|  |         HmacResponse *output = [api hmacRequest:arg_request error:&error]; | ||||||
|  |         callback(wrapResult(output, error)); | ||||||
|  |       }]; | ||||||
|  |     } else { | ||||||
|  |       [channel setMessageHandler:nil]; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |   { | ||||||
|  |     FlutterBasicMessageChannel *channel = | ||||||
|  |       [[FlutterBasicMessageChannel alloc] | ||||||
|  |         initWithName:@"dev.flutter.pigeon.NativeCryptoAPI.generateSecureRandom" | ||||||
|  |         binaryMessenger:binaryMessenger | ||||||
|  |         codec:NativeCryptoAPIGetCodec()]; | ||||||
|  |     if (api) { | ||||||
|  |       NSCAssert([api respondsToSelector:@selector(generateSecureRandomRequest:error:)], @"NativeCryptoAPI api (%@) doesn't respond to @selector(generateSecureRandomRequest:error:)", api); | ||||||
|  |       [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { | ||||||
|  |         NSArray *args = message; | ||||||
|  |         GenerateSecureRandomRequest *arg_request = GetNullableObjectAtIndex(args, 0); | ||||||
|  |         FlutterError *error; | ||||||
|  |         GenerateSecureRandomResponse *output = [api generateSecureRandomRequest:arg_request error:&error]; | ||||||
|  |         callback(wrapResult(output, error)); | ||||||
|  |       }]; | ||||||
|  |     } else { | ||||||
|  |       [channel setMessageHandler:nil]; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |   { | ||||||
|  |     FlutterBasicMessageChannel *channel = | ||||||
|  |       [[FlutterBasicMessageChannel alloc] | ||||||
|  |         initWithName:@"dev.flutter.pigeon.NativeCryptoAPI.pbkdf2" | ||||||
|  |         binaryMessenger:binaryMessenger | ||||||
|  |         codec:NativeCryptoAPIGetCodec()]; | ||||||
|  |     if (api) { | ||||||
|  |       NSCAssert([api respondsToSelector:@selector(pbkdf2Request:error:)], @"NativeCryptoAPI api (%@) doesn't respond to @selector(pbkdf2Request:error:)", api); | ||||||
|  |       [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { | ||||||
|  |         NSArray *args = message; | ||||||
|  |         Pbkdf2Request *arg_request = GetNullableObjectAtIndex(args, 0); | ||||||
|  |         FlutterError *error; | ||||||
|  |         Pbkdf2Response *output = [api pbkdf2Request:arg_request error:&error]; | ||||||
|  |         callback(wrapResult(output, error)); | ||||||
|  |       }]; | ||||||
|  |     } else { | ||||||
|  |       [channel setMessageHandler:nil]; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |   { | ||||||
|  |     FlutterBasicMessageChannel *channel = | ||||||
|  |       [[FlutterBasicMessageChannel alloc] | ||||||
|  |         initWithName:@"dev.flutter.pigeon.NativeCryptoAPI.encrypt" | ||||||
|  |         binaryMessenger:binaryMessenger | ||||||
|  |         codec:NativeCryptoAPIGetCodec()]; | ||||||
|  |     if (api) { | ||||||
|  |       NSCAssert([api respondsToSelector:@selector(encryptRequest:error:)], @"NativeCryptoAPI api (%@) doesn't respond to @selector(encryptRequest:error:)", api); | ||||||
|  |       [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { | ||||||
|  |         NSArray *args = message; | ||||||
|  |         EncryptRequest *arg_request = GetNullableObjectAtIndex(args, 0); | ||||||
|  |         FlutterError *error; | ||||||
|  |         EncryptResponse *output = [api encryptRequest:arg_request error:&error]; | ||||||
|  |         callback(wrapResult(output, error)); | ||||||
|  |       }]; | ||||||
|  |     } else { | ||||||
|  |       [channel setMessageHandler:nil]; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |   { | ||||||
|  |     FlutterBasicMessageChannel *channel = | ||||||
|  |       [[FlutterBasicMessageChannel alloc] | ||||||
|  |         initWithName:@"dev.flutter.pigeon.NativeCryptoAPI.decrypt" | ||||||
|  |         binaryMessenger:binaryMessenger | ||||||
|  |         codec:NativeCryptoAPIGetCodec()]; | ||||||
|  |     if (api) { | ||||||
|  |       NSCAssert([api respondsToSelector:@selector(decryptRequest:error:)], @"NativeCryptoAPI api (%@) doesn't respond to @selector(decryptRequest:error:)", api); | ||||||
|  |       [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { | ||||||
|  |         NSArray *args = message; | ||||||
|  |         DecryptRequest *arg_request = GetNullableObjectAtIndex(args, 0); | ||||||
|  |         FlutterError *error; | ||||||
|  |         DecryptResponse *output = [api decryptRequest:arg_request error:&error]; | ||||||
|  |         callback(wrapResult(output, error)); | ||||||
|  |       }]; | ||||||
|  |     } else { | ||||||
|  |       [channel setMessageHandler:nil]; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |   { | ||||||
|  |     FlutterBasicMessageChannel *channel = | ||||||
|  |       [[FlutterBasicMessageChannel alloc] | ||||||
|  |         initWithName:@"dev.flutter.pigeon.NativeCryptoAPI.encryptFile" | ||||||
|  |         binaryMessenger:binaryMessenger | ||||||
|  |         codec:NativeCryptoAPIGetCodec()]; | ||||||
|  |     if (api) { | ||||||
|  |       NSCAssert([api respondsToSelector:@selector(encryptFileRequest:error:)], @"NativeCryptoAPI api (%@) doesn't respond to @selector(encryptFileRequest:error:)", api); | ||||||
|  |       [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { | ||||||
|  |         NSArray *args = message; | ||||||
|  |         EncryptFileRequest *arg_request = GetNullableObjectAtIndex(args, 0); | ||||||
|  |         FlutterError *error; | ||||||
|  |         EncryptFileResponse *output = [api encryptFileRequest:arg_request error:&error]; | ||||||
|  |         callback(wrapResult(output, error)); | ||||||
|  |       }]; | ||||||
|  |     } else { | ||||||
|  |       [channel setMessageHandler:nil]; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |   { | ||||||
|  |     FlutterBasicMessageChannel *channel = | ||||||
|  |       [[FlutterBasicMessageChannel alloc] | ||||||
|  |         initWithName:@"dev.flutter.pigeon.NativeCryptoAPI.decryptFile" | ||||||
|  |         binaryMessenger:binaryMessenger | ||||||
|  |         codec:NativeCryptoAPIGetCodec()]; | ||||||
|  |     if (api) { | ||||||
|  |       NSCAssert([api respondsToSelector:@selector(decryptFileRequest:error:)], @"NativeCryptoAPI api (%@) doesn't respond to @selector(decryptFileRequest:error:)", api); | ||||||
|  |       [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { | ||||||
|  |         NSArray *args = message; | ||||||
|  |         DecryptFileRequest *arg_request = GetNullableObjectAtIndex(args, 0); | ||||||
|  |         FlutterError *error; | ||||||
|  |         DecryptFileResponse *output = [api decryptFileRequest:arg_request error:&error]; | ||||||
|  |         callback(wrapResult(output, error)); | ||||||
|  |       }]; | ||||||
|  |     } else { | ||||||
|  |       [channel setMessageHandler:nil]; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  |   { | ||||||
|  |     FlutterBasicMessageChannel *channel = | ||||||
|  |       [[FlutterBasicMessageChannel alloc] | ||||||
|  |         initWithName:@"dev.flutter.pigeon.NativeCryptoAPI.encryptWithIV" | ||||||
|  |         binaryMessenger:binaryMessenger | ||||||
|  |         codec:NativeCryptoAPIGetCodec()]; | ||||||
|  |     if (api) { | ||||||
|  |       NSCAssert([api respondsToSelector:@selector(encryptWithIVRequest:error:)], @"NativeCryptoAPI api (%@) doesn't respond to @selector(encryptWithIVRequest:error:)", api); | ||||||
|  |       [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { | ||||||
|  |         NSArray *args = message; | ||||||
|  |         EncryptWithIVRequest *arg_request = GetNullableObjectAtIndex(args, 0); | ||||||
|  |         FlutterError *error; | ||||||
|  |         EncryptResponse *output = [api encryptWithIVRequest:arg_request error:&error]; | ||||||
|  |         callback(wrapResult(output, error)); | ||||||
|  |       }]; | ||||||
|  |     } else { | ||||||
|  |       [channel setMessageHandler:nil]; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user