ESPSecurity2

class ESPSecurity2 : ESPCodeable

The ESPSecurity1 class conforms and implememnt methods of ESPCodeable protocol. This class provides methods for handling request/response data in a secure communication.

  • Undocumented

    Declaration

    Swift

    var sessionKey: SymmetricKey?
  • Create Security 1 implementation with given proof of possession

    Declaration

    Swift

    init(username: String, password: String)

    Parameters

    proofOfPossession

    Proof of possession identifying the ESPDevice.

  • Get the next request based upon the current session, state and the response data passed to this function

    Throws

    Security errors.

    Declaration

    Swift

    func getNextRequestInSession(data: Data?) throws -> Data?

    Parameters

    data

    Data that was received in the previous step.

    Return Value

    Data to be sent in the next step.

  • Encrypt data received in argument.

    Declaration

    Swift

    func encrypt(data: Data) -> Data?

    Parameters

    data

    Data to be sent.

    Return Value

    Encrypted data.

  • Decrypt data received in argument.

    Declaration

    Swift

    func decrypt(data: Data) -> Data?

    Parameters

    data

    Data to be sent.

    Return Value

    Decrypted data.