DeviceContext

public class DeviceContext : SdkObject

Signing and encryption key pairs and metadata for a device.

Required to initialize the SDK with a set of device keys (see IronOxide.initialize).

Can be generated by calling SDK.generateNewDevice and passing the result to DeviceContext.init.

  • Constructs a DeviceContext from its components.

    To instead generate a new DeviceContext for the user, call SDK.generate_new_device and pass the result to DeviceContext.init.

    Declaration

    Swift

    public convenience init(userId: UserId, segmentId: UInt64, devicePrivateKey: PrivateKey, signingPrivateKey: DeviceSigningKeyPair)
  • Attempts to construct a DeviceContext from the provided JSON string. Expects the keys to be

    • accountId: string
    • segmentId: int
    • devicePrivateKey: Base64 encoded string
    • signingPrivateKey: Base64 encoded string

    Declaration

    Swift

    public convenience init?(deviceContextJson: String)
  • Constructs a DeviceContext from a DeviceAddResult, the result of SDK.generateNewDevice.

    Declaration

    Swift

    public convenience init(deviceAddResult: DeviceAddResult)
  • ID of the device’s owner

    Declaration

    Swift

    public lazy var accountId: UserId { get set }
  • ID of the segment

    Declaration

    Swift

    public lazy var segmentId: UInt { get set }
  • Private encryption key of the device

    Declaration

    Swift

    public lazy var devicePrivateKey: PrivateKey { get set }
  • Private signing key of the device

    Declaration

    Swift

    public lazy var signingPrivateKey: DeviceSigningKeyPair { get set }