Initialize

Class to initialize the library.

  • Class to manage initialization of the runtime library.

    This class contains the functions needed to initialize the BlackBerry AppSecure library within your application.

    Initialization States

    The BlackBerry AppSecure runtime maintains the initialization state of the library within the application. The programming interfaces that can be utilized by the application depend on its current initialization state.

    Initialization States Diagram

    • The state of the runtime when the application starts is InitializationState/initial. In this state, the application can call enableSecurity() but cannot utilize any principal interfaces, such as getting the threat status or changing security configuration.

    • The first time enableSecurity() is called, the runtime enters the InitializationState/registration state. In this state the library is initialized, secure storage is provisioned and the recommended settings for detecting threats is configured. However, the library is not yet active. To enable the library so it can retrieve the latest detection models from BlackBerry and scan for threats a valid user identity token is required.

    • Call provideToken(_:) including a valid OpenID Connect Identity token for the user. This token may be issued by any OpenID Connect compliant Identity Provider used by your application. While the token is being validated by BlackBerry Identity the runtime will transition momentarily to the InitializationState/tokenValidation state.

    • Once validated the library will automatically transition to the InitializationState/active state. In this state all the principle interfaces may be utilized. The application should generally wait to be notified of transition to the InitializationState/active state before attempting to utilize any other BlackBerry AppSecure interfaces.

    • Access to the interfaces may be temporarily withdrawn if the Identity Token for the user expires. When this happens the initialization state changes to InitializationState/tokenExpired. To keep the library active, call provideToken(_:) with an updated Identity Token.

    Application Authentication

    This optional feature enables a user to set an application password or PIN during setup which is then required to subsequently login to the application. Requiring an application password further protects access to the runtime’s Secure Storage and controls authorized access when the device is off-line.

    Call enableSecurity() with the configuration key InitializationState/authenticationRequired to enable this feature. See AppAuthentication for details.

    See more

    Declaration

    Swift

    @objc
    public class SecurityControl : NSObject
  • Enumeration for the JSON Web Token (JWT) authorization related error domains.

    This enumeration represents the domain of an ErrorType. The domain categories subdivide errors into functional areas to facilitate troubleshooting.

    See more

    Declaration

    Swift

    @objc
    public enum ErrorDomain : Int, CaseIterable, CustomStringConvertible
  • Enumeration for JSON Web Token (JWT) authorization related errors.

    This enumeration represents errors that may be encountered when using JWT authorization.

    Each enumeration has a brief description associated with it and an ErrorDomain which can be used to troubleshoot configuration issues.

    See more

    Declaration

    Swift

    @objc
    public enum ErrorType : Int, CaseIterable, CustomStringConvertible, ErrorDomainConvertible