Functions

The following functions are available globally.

  • Verifies the existence of a user using a JWT to identify their user record.

    Returns nil if the user could not be found.

    Declaration

    Swift

    public func userVerify(jwt: Jwt, timeout: Duration? = nil) -> Result<UserResult?, IronOxideError>

    Parameters

    jwt

    Valid IronCore or Auth0 JWT

    timeout

    Timeout for this operation or nil for no timeout

  • Creates a user.

    Declaration

    Swift

    public func userCreate(
        jwt: Jwt,
        password: String,
        options: UserCreateOpts = UserCreateOpts(),
        timeout: Duration? = nil
    ) -> Result<UserCreateResult, IronOxideError>

    Parameters

    jwt

    Valid IronCore or Auth0 JWT

    password

    Password to use for encrypting and escrowing the user’s private key

    options

    User creation parameters

    timeout

    Timeout for this operation or nil for no timeout

  • Generates a new device for the user specified in the JWT.

    This will result in a new transform key (from the user’s master private key to the new device’s public key) being generated and stored with the IronCore Service.

    Declaration

    Swift

    public func generateNewDevice(
        jwt: Jwt,
        password: String,
        options: DeviceCreateOpts = DeviceCreateOpts(),
        timeout: Duration? = nil
    ) -> Result<DeviceAddResult, IronOxideError>

    Parameters

    jwt

    Valid IronCore or Auth0 JWT

    password

    Password for the user specified in the JWT

    options

    Device creation parameters

    timeout

    Timeout for this operation or nil for no timeout

  • Initializes the IronOxide SDK with a device.

    Verifies that the provided user/segment exists and the provided device keys are valid and exist for the provided account.

    Declaration

    Swift

    public func initialize(device: DeviceContext, config: IronOxideConfig = IronOxideConfig()) -> Result<SDK, IronOxideError>

    Parameters

    device

    Device to use to initialize the SDK

    config

    Configuration options to apply to the resulting SDK

  • Initializes IronOxide with a device, then rotates private keys where necessary for the user and their groups.

    Verifies that the provided user/segment exists and the provided device keys are valid and exist for the provided account. After initialization, checks whether the calling user’s private key needs rotation and rotates it if necessary, then does the same for each group the user is an admin of.

    This takes an optional timeout that is used for the rotation call. This is separate from the config timeout because it is expected that rotation could take significantly longer than other operations.

    Declaration

    Swift

    public func initializeAndRotate(
        device: DeviceContext,
        password: String,
        config: IronOxideConfig = IronOxideConfig(),
        timeout: Duration?
    ) -> Result<SDK, IronOxideError>

    Parameters

    device

    Device to use to initialize the SDK

    password

    User’s password needed for rotation

    config

    Configuration options to apply to the resulting SDK

    timeout

    Timeout to use for rotation