ESPCodeable

public protocol ESPCodeable

Security interface which abstracts the handshake and crypto behavior supported by a specific class/family of devices.

  • 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 according to the Security implementation

    Declaration

    Swift

    func encrypt(data: Data) -> Data?

    Parameters

    data

    data to be sent

    Return Value

    encrypted version

  • Decrypt data according to the security implementation

    Declaration

    Swift

    func decrypt(data: Data) -> Data?

    Parameters

    data

    data from device

    Return Value

    decrypted data