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
DeviceContextfrom its components.To instead generate a new
DeviceContextfor the user, callSDK.generate_new_deviceand pass the result toDeviceContext.init.Declaration
Swift
public convenience init(userId: UserId, segmentId: UInt64, devicePrivateKey: PrivateKey, signingPrivateKey: DeviceSigningKeyPair) -
Attempts to construct a
DeviceContextfrom 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
DeviceContextfrom aDeviceAddResult, the result ofSDK.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 }
View on GitHub
DeviceContext Class Reference