Config
public struct Config: Codable
Configuration for the E3DB Client
-
The name for this client
Declaration
Swift
public let clientName: String -
The client identifier
Declaration
Swift
public let clientId: UUID -
The API key identifier
Declaration
Swift
public let apiKeyId: String -
The API secret for making authenticated calls
Declaration
Swift
public let apiSecret: String -
The client’s public encryption key
Declaration
Swift
public let publicKey: String -
The client’s secret encryption key
Declaration
Swift
public let privateKey: String -
The base URL for the E3DB service
Declaration
Swift
public let baseApiUrl: URL -
The client’s public signing key
Declaration
Swift
public let publicSigKey: String -
The client’s secret signing key
Declaration
Swift
public let privateSigKey: String -
init(clientName:clientId:apiKeyId:apiSecret:publicKey:privateKey:baseApiUrl:publicSigKey:privateSigKey:)Initializer to customize the configuration of the client. Typically, library users will use the
Client.register(token:clientName:apiUrl:completion:)method which will supply an initializedConfigobject. Use this initializer if you register with the other registration method,Client.register(token:clientName:publicKey:apiUrl:completion:). Pass this object to theClient(config:)initializer to create a newClient.Declaration
Swift
public init( clientName: String, clientId: UUID, apiKeyId: String, apiSecret: String, publicKey: String, privateKey: String, baseApiUrl: URL, publicSigKey: String, privateSigKey: String )Parameters
clientNameThe name for this client
clientIdThe client identifier
apiKeyIdThe API key identifier
apiSecretThe API secret for making authenticated calls
publicKeyThe client’s public key
privateKeyThe client’s secret key
baseApiUrlThe base URL for the E3DB service
-
Securely load a profile using the device’s Secure Enclave if available.
Important
Accessing this Keychain data will require the user to confirm their presence via biometrics (e.g. Touch ID or Face ID) or passcode entry. If no passcode is set on the device, this method will fail. Data may be lost when the user removes an entry (fingerprint, face, or passcode) from the device.
See also
init(loadProfile:keychainAccess:)for loadingConfigobjects from the Keychain without the Secure Enclave.See also
save(profile:enclaveAccess:)for storing theConfigobject using the Secure Enclave.Declaration
Swift
public init?(loadProfile: String? = nil, userPrompt: String? = nil, enclaveAccess: ConfigAccessControl.SecureEnclave = .biometricAny)Parameters
loadProfileName of the profile that was previously saved. Uses internal default if unspecified.
userPromptA message used to inform the user about unlocking the profile. Uses internal default if unspecified.
enclaveAccessThe Secure Enclave access control level used to protect the configuration when saved. Uses
.biometricAnyif unspecified.Return Value
A fully initialized
Configobject if successful,nilotherwise. -
Securely load a profile from the device’s Keychain.
See also
init(loadProfile:userPrompt:enclaveAccess:)for loadingConfigobjects from the Keychain using the Secure Enclave.See also
save(profile:keychainAccess:)for storing theConfigobject in the Keychain.Declaration
Swift
public init?(loadProfile: String? = nil, keychainAccess: ConfigAccessControl.Keychain)Parameters
loadProfileName of the profile that was previously saved. Uses internal default if unspecified.
keychainAccessThe Keychain access control level used to protect the configuration when saved.
Return Value
A fully initialized
Configobject if successful,nilotherwise. -
Securely store a profile using the device’s Secure Enclave if available.
Important
Accessing this Keychain data will require the user to confirm their presence via biometrics (e.g. Touch ID or Face ID) or passcode entry. If no passcode is set on the device, this method will fail. Data may be lost when the user removes an entry (fingerprint, face, or passcode) from the device.
See also
save(profile:keychainAccess:)for storing theConfigobject.See also
init(loadProfile:userPrompt:enclaveAccess:)for loadingConfigobjects from the Keychain using the Secure Enclave.Declaration
Swift
public func save(profile: String? = nil, enclaveAccess: ConfigAccessControl.SecureEnclave = .biometricAny) -> BoolParameters
profileIdentifier for the profile for loading later. Uses internal default if unspecified.
enclaveAccessThe Secure Enclave access control level used to protect the configuration. Uses
.biometricAnyif unspecified.Return Value
A boolean value indicating whether the config object was successfully saved.
-
Securely store a profile in the device Keychain.
See also
init(loadProfile:keychainAccess:)for loadingConfigobjects from the device Keychain.Declaration
Swift
public func save(profile: String? = nil, keychainAccess: ConfigAccessControl.Keychain) -> BoolParameters
profileIdentifier for the profile for loading later. Uses internal default if unspecified.
keychainAccessThe Keychain access control level to protect the configuration.
Return Value
A boolean value indicating whether the config object was successfully saved.
View on GitHub
Config Structure Reference