ARTCrypto

Objective-C

@interface ARTCrypto : NSObject

Swift

class ARTCrypto : NSObject

Contains the properties required to configure the encryption of ARTMessage payloads.

  • Returns an ARTCipherParams object, using the default values for any fields not supplied by the cipherParams dictionary.

    Declaration

    Objective-C

    + (nonnull ARTCipherParams *)getDefaultParams:
        (nonnull NSDictionary *)cipherParams;

    Swift

    class func getDefaultParams(_ cipherParams: [AnyHashable : Any]) -> ARTCipherParams

    Parameters

    cipherParams

    An ARTCipherParams-like dictionary object.

    Return Value

    An ARTCipherParams object, using the default values for any fields not supplied.

  • Generates a random key to be used in the encryption of the channel.

    Declaration

    Objective-C

    + (nonnull NSData *)generateRandomKey:(NSUInteger)length;

    Swift

    class func generateRandomKey(_ length: UInt) -> Data

    Parameters

    length

    The length of the key, in bits, to be generated.

    Return Value

    The key as a binary NSData.

  • Generates a random key to be used in the encryption of the channel. Here the default key length of the default algorithm is used: for AES this is 256 bits.

    Declaration

    Objective-C

    + (nonnull NSData *)generateRandomKey;

    Swift

    class func generateRandomKey() -> Data

    Return Value

    The key as a binary NSData.

  • Undocumented

    Declaration

    Objective-C

    + (NSString *)defaultAlgorithm;

    Swift

    class func defaultAlgorithm() -> String
  • Undocumented

    Declaration

    Objective-C

    + (int)defaultKeyLength;

    Swift

    class func defaultKeyLength() -> Int32
  • Undocumented

    Declaration

    Objective-C

    + (int)defaultBlockLength;

    Swift

    class func defaultBlockLength() -> Int32
  • Undocumented

    Declaration

    Objective-C

    + (nullable NSMutableData *)generateSecureRandomData:(size_t)length;

    Swift

    class func generateSecureRandomData(_ length: Int) -> NSMutableData?
  • Undocumented

    Declaration

    Objective-C

    + (NSData *)generateHashSHA256:(NSData *)data;

    Swift

    class func generateHashSHA256(_ data: Data) -> Data
  • Undocumented

    Declaration

    Objective-C

    + (id<ARTChannelCipher>)cipherWithParams:(ARTCipherParams *)params logger:(ARTInternalLog *)logger;

    Swift

    class func cipher(with params: ARTCipherParams, logger: InternalLog) -> any ARTChannelCipher