KeyknoxClient

@objc(VSSKeyknoxClient)
open class KeyknoxClient : BaseClient
extension KeyknoxClient: KeyknoxClientProtocol

Class representing operations with Virgil Keyknox service

Queries

  • Header key for blob hash

    Declaration

    Swift

    @objc
    public static let virgilKeyknoxHashKey: String
  • Header key for previous blob hash

    Declaration

    Swift

    @objc
    public static let virgilKeyknoxPreviousHashKey: String
  • Default root value

    Declaration

    Swift

    @objc
    public static let keyStorageRoot: String
  • Default path value

    Declaration

    Swift

    @objc
    public static let keyStoragePath: String
  • Default key value

    Declaration

    Swift

    @objc
    public static let keyStorageKey: String
  • Push value to Keyknox service

    Throws

    • KeyknoxClientError.emptyIdentities, if identities are empty
    • KeyknoxClientError.constructingUrl, if url initialization failed
    • KeyknoxClientError.invalidOptions, if internal options error occured
    • ServiceError, if service returned correctly-formed error json
    • NSError with KeyknoxClient.serviceErrorDomain error domain, http status code as error code, and description string if present in http body
    • Rethrows from ServiceRequest, HttpConnectionProtocol, JsonDecoder, BaseClient

    Declaration

    Swift

    public func pushValue(params: KeyknoxPushParams? = nil,
                          meta: Data,
                          value: Data,
                          previousHash: Data?) throws -> EncryptedKeyknoxValue

    Parameters

    params

    params

    meta

    meta data

    value

    encrypted blob

    previousHash

    hash of previous blob

    Return Value

    EncryptedKeyknoxValue

  • Pulls values from Keyknox service

    Throws

    • KeyknoxClientError.constructingUrl, if url initialization failed
    • ServiceError, if service returned correctly-formed error json
    • NSError with KeyknoxClient.serviceErrorDomain error domain, http status code as error code, and description string if present in http body
    • Rethrows from ServiceRequest, HttpConnectionProtocol, JsonDecoder, BaseClient

    Declaration

    Swift

    public func pullValue(params: KeyknoxPullParams? = nil) throws -> EncryptedKeyknoxValue

    Parameters

    params

    Pull params

    Return Value

    EncryptedKeyknoxValue

  • Get keys for given root

    Throws

    • KeyknoxClientError.constructingUrl, if url initialization failed
    • ServiceError, if service returned correctly-formed error json
    • NSError with KeyknoxClient.serviceErrorDomain error domain, http status code as error code, and description string if present in http body
    • Rethrows from ServiceRequest, HttpConnectionProtocol, JsonDecoder, BaseClient

    Declaration

    Swift

    public func getKeys(params: KeyknoxGetKeysParams) throws -> Set<String>

    Parameters

    params

    Get keys params

    Return Value

    Array of keys

  • Resets Keyknox value (makes it empty)

    Throws

    • KeyknoxClientError.constructingUrl, if url initialization failed
    • ServiceError, if service returned correctly-formed error json
    • NSError with KeyknoxClient.serviceErrorDomain error domain, http status code as error code, and description string if present in http body
    • Rethrows from ServiceRequest, HttpConnectionProtocol, JsonDecoder, BaseClient

    Declaration

    Swift

    open func resetValue(params: KeyknoxResetParams? = nil) throws -> DecryptedKeyknoxValue

    Parameters

    params

    Reset params

    Return Value

    DecryptedKeyknoxValue

  • Deletes recipient

    Throws

    • KeyknoxClientError.constructingUrl, if url initialization failed
    • ServiceError, if service returned correctly-formed error json
    • NSError with KeyknoxClient.serviceErrorDomain error domain, http status code as error code, and description string if present in http body
    • Rethrows from ServiceRequest, HttpConnectionProtocol, JsonDecoder, BaseClient

    Declaration

    Swift

    open func deleteRecipient(params: KeyknoxDeleteRecipientParams) throws -> DecryptedKeyknoxValue

    Parameters

    params

    Delete recipient params

    Return Value

    DecryptedKeyknoxValue