| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent bc1e4ea commit 121d309
40 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -93,6 +93,37 @@ | |||
| 93 | 93 | <key>SupportedPlatform</key> | |
| 94 | 94 | <string>ios</string> | |
| 95 | 95 | </dict> | |
| 96 | + <dict> | ||
| 97 | + <key>BinaryPath</key> | ||
| 98 | + <string>NSCWinterTC.framework/NSCWinterTC</string> | ||
| 99 | + <key>LibraryIdentifier</key> | ||
| 100 | + <string>tvos-arm64</string> | ||
| 101 | + <key>LibraryPath</key> | ||
| 102 | + <string>NSCWinterTC.framework</string> | ||
| 103 | + <key>SupportedArchitectures</key> | ||
| 104 | + <array> | ||
| 105 | + <string>arm64</string> | ||
| 106 | + </array> | ||
| 107 | + <key>SupportedPlatform</key> | ||
| 108 | + <string>tvos</string> | ||
| 109 | + </dict> | ||
| 110 | + <dict> | ||
| 111 | + <key>BinaryPath</key> | ||
| 112 | + <string>NSCWinterTC.framework/NSCWinterTC</string> | ||
| 113 | + <key>LibraryIdentifier</key> | ||
| 114 | + <string>tvos-arm64_x86_64-simulator</string> | ||
| 115 | + <key>LibraryPath</key> | ||
| 116 | + <string>NSCWinterTC.framework</string> | ||
| 117 | + <key>SupportedArchitectures</key> | ||
| 118 | + <array> | ||
| 119 | + <string>arm64</string> | ||
| 120 | + <string>x86_64</string> | ||
| 121 | + </array> | ||
| 122 | + <key>SupportedPlatform</key> | ||
| 123 | + <string>tvos</string> | ||
| 124 | + <key>SupportedPlatformVariant</key> | ||
| 125 | + <string>simulator</string> | ||
| 126 | + </dict> | ||
| 96 | 127 | </array> | |
| 97 | 128 | <key>CFBundlePackageType</key> | |
| 98 | 129 | <string>XFWK</string> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,79 @@ | |||
| 1 | + // | ||
| 2 | + // NSCCrypto.h | ||
| 3 | + // NSCWinterTC | ||
| 4 | + // | ||
| 5 | + // Created by Osei Fortune on 03/07/2024. | ||
| 6 | + // Copyright © 2024 NativeScript. All rights reserved. | ||
| 7 | + // | ||
| 8 | + | ||
| 9 | + #import <Foundation/Foundation.h> | ||
| 10 | + #import <CommonCrypto/CommonCrypto.h> | ||
| 11 | + #import <Security/Security.h> | ||
| 12 | + #import <Security/SecItem.h> | ||
| 13 | + #ifndef NSCCrypto_h | ||
| 14 | + #define NSCCrypto_h | ||
| 15 | + | ||
| 16 | + typedef enum : NSUInteger { | ||
| 17 | + kNSCCryptoRSASSA_PKCS1_v1_5, | ||
| 18 | + kNSCCryptoRSA_PSS, | ||
| 19 | + kNSCCryptoRSA_OAEP, | ||
| 20 | + } NSCCryptoRsaHashedKeyGenParamsName; | ||
| 21 | + | ||
| 22 | + | ||
| 23 | + typedef enum : NSUInteger { | ||
| 24 | + kNSCCryptoHashSHA1, | ||
| 25 | + kNSCCryptoHashSHA256, | ||
| 26 | + kNSCCryptoHashSHA384, | ||
| 27 | + kNSCCryptoHashSHA512 | ||
| 28 | + } NSCCryptoHash; | ||
| 29 | + | ||
| 30 | + | ||
| 31 | + typedef enum : NSUInteger { | ||
| 32 | + kNSCCryptoDecrypt, | ||
| 33 | + kNSCCryptoEncrypt, | ||
| 34 | + kNSCCryptoSign, | ||
| 35 | + kNSCCryptoVerify, | ||
| 36 | + kNSCCryptoDeriveKey, | ||
| 37 | + kNSCCryptoDeriveBits, | ||
| 38 | + kNSCCryptoWrapKey, | ||
| 39 | + kNSCCryptoUnwrapKey, | ||
| 40 | + } NSCCryptoKeyUsages; | ||
| 41 | + | ||
| 42 | + | ||
| 43 | + | ||
| 44 | + @interface NSCCryptoKeyPair : NSObject | ||
| 45 | + @property (nonatomic, readonly, nonnull) SecKeyRef privateKey; | ||
| 46 | + @property (nonatomic, readonly, nonnull) SecKeyRef publicKey; | ||
| 47 | + -(nonnull id)initWithPrivateKey:(nonnull SecKeyRef)privKey andPublicKey:(nonnull SecKeyRef)pubKey; | ||
| 48 | + @end | ||
| 49 | + | ||
| 50 | + typedef void (^DigestCompletionHandler)(NSData * _Nullable result,NSError * _Nullable error); | ||
| 51 | + typedef void (^GenerateKeyCompletionHandler)(NSCCryptoKeyPair * _Nullable result,NSError * _Nullable error); | ||
| 52 | + typedef void (^DecryptCompletionHandler)(NSData * _Nullable result,NSError * _Nullable error); | ||
| 53 | + typedef void (^EncryptCompletionHandler)(NSData * _Nullable result,NSError * _Nullable error); | ||
| 54 | + | ||
| 55 | + | ||
| 56 | + @interface NSCCrypto:NSObject | ||
| 57 | + + (nonnull NSString*)randomUUID; | ||
| 58 | + + (nullable NSString*)getRandomValues:(nonnull NSMutableData*)buffer; | ||
| 59 | + + (nullable NSData*)digest:(nonnull NSData*)data mode:(int)mode; | ||
| 60 | + + (void)digest:(nonnull NSData*)data mode:(int)mode completion:(DigestCompletionHandler _Nonnull ) completion; | ||
| 61 | + + (nullable NSData *)generateKeyHmac:(int)hash length:(int)length; | ||
| 62 | + + (nullable NSData *)signHmac:(nonnull NSData*)key hash:(NSCCryptoHash)hash data:(nonnull NSData*)data; | ||
| 63 | + + (BOOL)verifyHmac:(nonnull NSData*)key hash:(NSCCryptoHash)hash signature:(nonnull NSData*)signature data:(nonnull NSData*)data; | ||
| 64 | + | ||
| 65 | + + (nullable NSCCryptoKeyPair*)generateKeyRsa:(NSCCryptoRsaHashedKeyGenParamsName)name modulusLength:(unsigned int)modulusLength publicExponent:(nullable void*)exponent size:(unsigned int)size hash:(NSCCryptoHash)hash extractable:(BOOL)extractable keyUsages:(nonnull NSArray*) usages; | ||
| 66 | + | ||
| 67 | + + (void)generateKeyRsa:(NSCCryptoRsaHashedKeyGenParamsName)name modulusLength:(unsigned int)modulusLength publicExponent:(nullable void*)exponent size:(unsigned int)size hash:(NSCCryptoHash)hash extractable:(BOOL)extractable keyUsages:(nonnull NSArray*) usages completion:(GenerateKeyCompletionHandler _Nonnull ) completion; | ||
| 68 | + | ||
| 69 | + | ||
| 70 | + | ||
| 71 | + + (nullable NSData *)encryptRsa:(BOOL)isPrivate key:(nonnull NSCCryptoKeyPair *)key hash:(NSCCryptoHash)hash data:(nonnull NSData*)data; | ||
| 72 | + | ||
| 73 | + + (void)encryptRsa:(BOOL)isPrivate key:(nonnull NSCCryptoKeyPair *)key hash:(NSCCryptoHash)hash data:(nonnull NSData*)data completion:(EncryptCompletionHandler _Nonnull ) completion; | ||
| 74 | + | ||
| 75 | + + (nullable NSData *)decryptRsa:(BOOL)isPrivate key:(nonnull NSCCryptoKeyPair *)key hash:(NSCCryptoHash)hash data:(nonnull NSData*)data; | ||
| 76 | + | ||
| 77 | + + (void)decryptRsa:(BOOL)isPrivate key:(nonnull NSCCryptoKeyPair *)key hash:(NSCCryptoHash)hash data:(nonnull NSData*)data completion:(DecryptCompletionHandler _Nonnull ) completion; | ||
| 78 | + @end | ||
| 79 | + #endif /* NSCCrypto_h */ | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,20 @@ | |||
| 1 | + // | ||
| 2 | + // NSCWinterTC.h | ||
| 3 | + // NSCWinterTC | ||
| 4 | + // | ||
| 5 | + // Created by Osei Fortune and Nathan Walker on 07/09/2024. | ||
| 6 | + // Copyright © 2024 NativeScript. All rights reserved. | ||
| 7 | + // | ||
| 8 | + | ||
| 9 | + #import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | + //! Project version number for NSCWinterTC. | ||
| 12 | + FOUNDATION_EXPORT double NSCWinterTCVersionNumber; | ||
| 13 | + | ||
| 14 | + //! Project version string for NSCWinterTC. | ||
| 15 | + FOUNDATION_EXPORT const unsigned char NSCWinterTCVersionString[]; | ||
| 16 | + | ||
| 17 | + // In this header, you should import all the public headers of your framework using statements like #import <NSCWinterTC/PublicHeader.h> | ||
| 18 | + | ||
| 19 | + #import "NSCCrypto.h" | ||
| 20 | + #import "NSString+WinterTC.h" | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,21 @@ | |||
| 1 | + // | ||
| 2 | + // NSString+WinterTC.h | ||
| 3 | + // NSCWinterTC | ||
| 4 | + // | ||
| 5 | + // Created by Osei Fortune and Nathan Walker on 07/09/2024. | ||
| 6 | + // Copyright © 2024 NativeScript. All rights reserved. | ||
| 7 | + // | ||
| 8 | + | ||
| 9 | + #import <Foundation/Foundation.h> | ||
| 10 | + | ||
| 11 | + NS_ASSUME_NONNULL_BEGIN | ||
| 12 | + | ||
| 13 | + @interface NSString (WinterTC) | ||
| 14 | + | ||
| 15 | + + (NSString*)atob:(nonnull NSString*)data; | ||
| 16 | + | ||
| 17 | + + (NSString*)btoa:(nonnull NSString*)stringToEncode; | ||
| 18 | + | ||
| 19 | + @end | ||
| 20 | + | ||
| 21 | + NS_ASSUME_NONNULL_END | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,6 @@ | |||
| 1 | + framework module NSCWinterTC { | ||
| 2 | + umbrella header "NSCWinterTC.h" | ||
| 3 | + export * | ||
| 4 | + | ||
| 5 | + module * { export * } | ||
| 6 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,79 @@ | |||
| 1 | + // | ||
| 2 | + // NSCCrypto.h | ||
| 3 | + // NSCWinterTC | ||
| 4 | + // | ||
| 5 | + // Created by Osei Fortune on 03/07/2024. | ||
| 6 | + // Copyright © 2024 NativeScript. All rights reserved. | ||
| 7 | + // | ||
| 8 | + | ||
| 9 | + #import <Foundation/Foundation.h> | ||
| 10 | + #import <CommonCrypto/CommonCrypto.h> | ||
| 11 | + #import <Security/Security.h> | ||
| 12 | + #import <Security/SecItem.h> | ||
| 13 | + #ifndef NSCCrypto_h | ||
| 14 | + #define NSCCrypto_h | ||
| 15 | + | ||
| 16 | + typedef enum : NSUInteger { | ||
| 17 | + kNSCCryptoRSASSA_PKCS1_v1_5, | ||
| 18 | + kNSCCryptoRSA_PSS, | ||
| 19 | + kNSCCryptoRSA_OAEP, | ||
| 20 | + } NSCCryptoRsaHashedKeyGenParamsName; | ||
| 21 | + | ||
| 22 | + | ||
| 23 | + typedef enum : NSUInteger { | ||
| 24 | + kNSCCryptoHashSHA1, | ||
| 25 | + kNSCCryptoHashSHA256, | ||
| 26 | + kNSCCryptoHashSHA384, | ||
| 27 | + kNSCCryptoHashSHA512 | ||
| 28 | + } NSCCryptoHash; | ||
| 29 | + | ||
| 30 | + | ||
| 31 | + typedef enum : NSUInteger { | ||
| 32 | + kNSCCryptoDecrypt, | ||
| 33 | + kNSCCryptoEncrypt, | ||
| 34 | + kNSCCryptoSign, | ||
| 35 | + kNSCCryptoVerify, | ||
| 36 | + kNSCCryptoDeriveKey, | ||
| 37 | + kNSCCryptoDeriveBits, | ||
| 38 | + kNSCCryptoWrapKey, | ||
| 39 | + kNSCCryptoUnwrapKey, | ||
| 40 | + } NSCCryptoKeyUsages; | ||
| 41 | + | ||
| 42 | + | ||
| 43 | + | ||
| 44 | + @interface NSCCryptoKeyPair : NSObject | ||
| 45 | + @property (nonatomic, readonly, nonnull) SecKeyRef privateKey; | ||
| 46 | + @property (nonatomic, readonly, nonnull) SecKeyRef publicKey; | ||
| 47 | + -(nonnull id)initWithPrivateKey:(nonnull SecKeyRef)privKey andPublicKey:(nonnull SecKeyRef)pubKey; | ||
| 48 | + @end | ||
| 49 | + | ||
| 50 | + typedef void (^DigestCompletionHandler)(NSData * _Nullable result,NSError * _Nullable error); | ||
| 51 | + typedef void (^GenerateKeyCompletionHandler)(NSCCryptoKeyPair * _Nullable result,NSError * _Nullable error); | ||
| 52 | + typedef void (^DecryptCompletionHandler)(NSData * _Nullable result,NSError * _Nullable error); | ||
| 53 | + typedef void (^EncryptCompletionHandler)(NSData * _Nullable result,NSError * _Nullable error); | ||
| 54 | + | ||
| 55 | + | ||
| 56 | + @interface NSCCrypto:NSObject | ||
| 57 | + + (nonnull NSString*)randomUUID; | ||
| 58 | + + (nullable NSString*)getRandomValues:(nonnull NSMutableData*)buffer; | ||
| 59 | + + (nullable NSData*)digest:(nonnull NSData*)data mode:(int)mode; | ||
| 60 | + + (void)digest:(nonnull NSData*)data mode:(int)mode completion:(DigestCompletionHandler _Nonnull ) completion; | ||
| 61 | + + (nullable NSData *)generateKeyHmac:(int)hash length:(int)length; | ||
| 62 | + + (nullable NSData *)signHmac:(nonnull NSData*)key hash:(NSCCryptoHash)hash data:(nonnull NSData*)data; | ||
| 63 | + + (BOOL)verifyHmac:(nonnull NSData*)key hash:(NSCCryptoHash)hash signature:(nonnull NSData*)signature data:(nonnull NSData*)data; | ||
| 64 | + | ||
| 65 | + + (nullable NSCCryptoKeyPair*)generateKeyRsa:(NSCCryptoRsaHashedKeyGenParamsName)name modulusLength:(unsigned int)modulusLength publicExponent:(nullable void*)exponent size:(unsigned int)size hash:(NSCCryptoHash)hash extractable:(BOOL)extractable keyUsages:(nonnull NSArray*) usages; | ||
| 66 | + | ||
| 67 | + + (void)generateKeyRsa:(NSCCryptoRsaHashedKeyGenParamsName)name modulusLength:(unsigned int)modulusLength publicExponent:(nullable void*)exponent size:(unsigned int)size hash:(NSCCryptoHash)hash extractable:(BOOL)extractable keyUsages:(nonnull NSArray*) usages completion:(GenerateKeyCompletionHandler _Nonnull ) completion; | ||
| 68 | + | ||
| 69 | + | ||
| 70 | + | ||
| 71 | + + (nullable NSData *)encryptRsa:(BOOL)isPrivate key:(nonnull NSCCryptoKeyPair *)key hash:(NSCCryptoHash)hash data:(nonnull NSData*)data; | ||
| 72 | + | ||
| 73 | + + (void)encryptRsa:(BOOL)isPrivate key:(nonnull NSCCryptoKeyPair *)key hash:(NSCCryptoHash)hash data:(nonnull NSData*)data completion:(EncryptCompletionHandler _Nonnull ) completion; | ||
| 74 | + | ||
| 75 | + + (nullable NSData *)decryptRsa:(BOOL)isPrivate key:(nonnull NSCCryptoKeyPair *)key hash:(NSCCryptoHash)hash data:(nonnull NSData*)data; | ||
| 76 | + | ||
| 77 | + + (void)decryptRsa:(BOOL)isPrivate key:(nonnull NSCCryptoKeyPair *)key hash:(NSCCryptoHash)hash data:(nonnull NSData*)data completion:(DecryptCompletionHandler _Nonnull ) completion; | ||
| 78 | + @end | ||
| 79 | + #endif /* NSCCrypto_h */ | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,20 @@ | |||
| 1 | + // | ||
| 2 | + // NSCWinterTC.h | ||
| 3 | + // NSCWinterTC | ||
| 4 | + // | ||
| 5 | + // Created by Osei Fortune and Nathan Walker on 07/09/2024. | ||
| 6 | + // Copyright © 2024 NativeScript. All rights reserved. | ||
| 7 | + // | ||
| 8 | + | ||
| 9 | + #import <UIKit/UIKit.h> | ||
| 10 | + | ||
| 11 | + //! Project version number for NSCWinterTC. | ||
| 12 | + FOUNDATION_EXPORT double NSCWinterTCVersionNumber; | ||
| 13 | + | ||
| 14 | + //! Project version string for NSCWinterTC. | ||
| 15 | + FOUNDATION_EXPORT const unsigned char NSCWinterTCVersionString[]; | ||
| 16 | + | ||
| 17 | + // In this header, you should import all the public headers of your framework using statements like #import <NSCWinterTC/PublicHeader.h> | ||
| 18 | + | ||
| 19 | + #import "NSCCrypto.h" | ||
| 20 | + #import "NSString+WinterTC.h" | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,21 @@ | |||
| 1 | + // | ||
| 2 | + // NSString+WinterTC.h | ||
| 3 | + // NSCWinterTC | ||
| 4 | + // | ||
| 5 | + // Created by Osei Fortune and Nathan Walker on 07/09/2024. | ||
| 6 | + // Copyright © 2024 NativeScript. All rights reserved. | ||
| 7 | + // | ||
| 8 | + | ||
| 9 | + #import <Foundation/Foundation.h> | ||
| 10 | + | ||
| 11 | + NS_ASSUME_NONNULL_BEGIN | ||
| 12 | + | ||
| 13 | + @interface NSString (WinterTC) | ||
| 14 | + | ||
| 15 | + + (NSString*)atob:(nonnull NSString*)data; | ||
| 16 | + | ||
| 17 | + + (NSString*)btoa:(nonnull NSString*)stringToEncode; | ||
| 18 | + | ||
| 19 | + @end | ||
| 20 | + | ||
| 21 | + NS_ASSUME_NONNULL_END | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments