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.