EMSecureContainerFactory

Objective-C

@protocol EMSecureContainerFactory <NSObject>

Swift

protocol EMSecureContainerFactory : NSObjectProtocol

Secure Container Factory

  • Create a secure string object from a String.

    Declaration

    Objective-C

    - (id<EMSecureString>)secureStringFromString:(NSString *)string;

    Swift

    func secureString(from string: String!) -> (any EMSecureString)!

    Parameters

    string

    The string to securely store. The string will be converted to NSUTF8StringEncoding when stored in the ‘secure data’ object. String can’t be null

    Return Value

    A ‘secure data’ object that securely stores the data. @exception NSException When string is nil or if string encoding is not NSUTF8StringEncoding.

  • Create a secure string object from a String using a specific character set.

    Warning: This method does not guarantee that the given string and the given encoding is compatible.

    Declaration

    Objective-C

    - (id<EMSecureString>)secureStringFromString:(NSString *)string
                                        encoding:(NSStringEncoding)encoding;

    Swift

    func secureString(from string: String!, encoding: UInt) -> (any EMSecureString)!

    Parameters

    string

    The string to securely store. String can’t be null

    encoding

    The string will be converted to this encoding when stored in the ‘secure data’ object. It could be any NSStringEncoding, etc.

    Return Value

    A ‘secure data’ object that securely stores the data. @exception NSException When string is nil or if string encoding is not the one provided in encoding.

  • Create a secure string object from a NSData.

    Declaration

    Objective-C

    - (id<EMSecureString>)secureStringFromData:(NSData *)data
                                    wipeSource:(BOOL)wipeSource;

    Swift

    func secureString(from data: Data!, wipeSource: Bool) -> (any EMSecureString)!

    Parameters

    data

    Data to securely store.

    wipeSource

    If ‘true’, then the ‘data’ will be erased if the method returns successfully. Otherwise the input will not be modified.

    Return Value

    A ‘secure data’ object that securely stores the data.

  • Creates the secure byte array object.

    Declaration

    Objective-C

    - (id<EMSecureByteArray>)secureByteArrayWithData:(NSData *)data
                                          wipeSource:(BOOL)wipeSource;

    Swift

    func secureByteArray(with data: Data!, wipeSource: Bool) -> (any EMSecureByteArray)!

    Parameters

    data

    Data to store to the output object.

    wipeSource

    Pass true to wipe the original data.

    Return Value

    The secure byte array object.