EMSecureString

Objective-C

@protocol EMSecureString <EMSecureByteArray>

Swift

protocol EMSecureString : EMSecureByteArray

A protocol representing a secure container object in memory.

  • Returns a deep copy of the the value of data as an immutable NSString.

    Warning

    This method creates an immutable string which can be a potential security issue. Use CAREFULLY as this NSString cannot be wiped from memory even after sending -wipe to the EMSecureString object.

    Declaration

    Objective-C

    - (NSString *)stringValue;

    Swift

    func stringValue() -> String!

    Return Value

    An immutable NSString representation of the object.

  • Returns the length of the data in number of characters.

    Declaration

    Objective-C

    - (NSUInteger)stringLength;

    Swift

    func stringLength() -> UInt

    Return Value

    Number of characters in the string.

  • Appends EMSecureString object with another EMSecureString object.

    Warning

    EMSecureString objects that has been created with a custom string encoding (using [EMSecureDataFactory secureStringWithString:encoding:]) cannot be the receiver or data argument of this method.

    Declaration

    Objective-C

    - (id<EMSecureString>)append:(id<EMSecureString>)anotherString;

    Swift

    func append(_ anotherString: (any EMSecureString)!) -> (any EMSecureString)!

    Parameters

    anotherString

    The secure string to append.

    Return Value

    The new EMSecureString object containing the concatenation of the two secure strings.