Skip to content

API Keys

Overview

The connection between the SDK and the glasses involves a handshake process.

During this process, a signed digital glasses certificate is transferred from the SDK to the glasses to be validated by the glasses.

If valid, the connection is approved; otherwise the glasses disconnect the application.

In order to generate the glasses certificate and to enable connection to the glasses, the SDK needs an API Key.

There are 2 types of API Keys to be used:

Name Key file Usage When we provide this key?
Developer key sdk.key When developing your application using the SDK Request an SDK key
Runtime key app.key When publishing your application to the AppStore/GooglePlay Planned - see Roadmap

The API keys are sent by the SDK to the Everysight server when a new glasses certificate generation is required.

Note

When developing your application, ensure that you have the sdk.key provided with your Maverick AI Developer Edition.

Developer Key

The developer key, sdk.key, enables your application to connect the glasses during the development process.

The server, upon glasses certificate generation request, verifies that the developer license is valid for your glasses and generates the glasses certificate.

Both keys (sdk.key and app.key) enable the SDK to connect to the simulator.

Runtime Key

The application runtime key, app.key, is a runtime key that enables your application, when published to the AppStore/GooglePlay, to connect the glasses.

The server, upon glasses certificate generation request, verifies that the application is approved by Everysight to connect the Maverick AI glasses and generates the glasses certificate.

Unlike the sdk.key, the runtime app.key will enable your application to connect any glasses, even when your developer license is expired.

Using the API key

The API key file should be added to the application resources.

The SDK searches for the API key file in the following order:

  • Search for an app.key file
  • Search for an sdk.key file

Note

The API key file name should not be changed, and should be either sdk.key or app.key

Required Permissions

Android applications must have the internet permission in the AndroidManifest.xml to enable receiving the glasses certificate from the server:

AndroidManifest.xml
    ...
    <uses-permission android:name="android.permission.INTERNET" />
    ...

Simulator & sdk.key

The sdk.key also enables connecting to the simulator.

Manually set the API Key

In rare cases, when the API key file can't be added to the application resources, or a different naming is required, it can be set to the SDK directly:

Evs.setApiKeyName("my-key-name")

// You can also set the sdk.key/app.key file content directly:
Evs.setApiKey(apiKeyBytes)
Evs.shared.setApiKeyName(fileNameWithoutExt: "my-key-name")

// You can also set the sdk.key/app.key file content directly:
Evs.shared.setApiKey(apiKey: apiKeyBytes)

Note

The SDK automatically resolves the API key from application resources during connection. Manual key setting is only needed when the key file cannot follow the standard naming or placement conventions.

Glasses Certificate

As stated, the glasses certificate is generated by the Everysight server.

The SDK, when the SDK detects that the glasses certificate is missing or expired, requests the Everysight server to generate a new certificate.

The server, upon validating the api.key, generates the glasses certificate to be used by the SDK.

The certificate generation process is transparent to the application and/or the developer, but requires the application to have internet access.

Info

To reduce the need to access the Everysight server, the SDK persists the glasses certificate.

Since the glasses certificate is generated with 30 days expiration, the server access is performed only once in a while.


See Also