Virtual USB Tools - Advanced USB to TCP/IP network configurations for your USB usage scenario
Download Virtual USB Tools Hide this button

ITrustedServersDatabase Interface

This interface is implemented by a trusted servers database object. An instance of this object is obtained using the IUsbClient.trustedServersDb property.

Declaration

interface ITrustedServersDatabase {
    // Properties
    readonly ${trustedServersJs}: string[];

    // Methods
    ${addTrustedServer}(remoteAddress: string, publicKey: ${IPublicKey}): void;
    ${removeTrustedServer}(remoteAddress: string): void;
    ${getTrustedServerKey}(remoteAddress: string): ${IPublicKey};
    ${createPublicKey}(base64Key: string): ${IPublicKey};
    ${clearDatabase}(): void;
}
public interface ITrustedServersDatabase
{
    // Properties
    Array ${trustedServers} { get; }

    // Methods
    void ${addTrustedServer}(string remoteAddress, ${IPublicKey} publicKey);
    void ${removeTrustedServer}(string remoteAddress);
    ${IPublicKey} ${getTrustedServerKey}(string remoteAddress);
    ${IPublicKey} ${createPublicKey}(string base64Key);
    void ${clearDatabase}();
}
struct ITrustedServersDatabase : IDispatch
{
    // Properties
    SAFEARRAY(string) ${trustedServers};  // get 

    // Methods
    HRESULT ${addTrustedServer}(_bstr_t remoteAddress, ${IPublicKey *#IPublicKey} publicKey);
    HRESULT ${removeTrustedServer}(string remoteAddress);
    ${IPublicKeyPtr#IPublicKey} ${getTrustedServerKey}(_bstr_t remoteAddress);
    ${IPublicKeyPtr#IPublicKey} ${createPublicKey}(_bstr_t base64Key);
    HRESULT ${clearDatabase}();
};

ITrustedServersDatabase Properties

trustedServers

// This property is not available in scripting environment
Array trustedServers { get; }
SAFEARRAY(string) trustedServers;  // get 

Returns a list of all trusted servers as a string array.

trustedServersJs

readonly trustedServersJs: string[];
// This property is not available in managed environment
// This property is not available in native environment

Returns a list of all trusted servers as a string array.

ITrustedServersDatabase Methods

addTrustedServer

addTrustedServer(remoteAddress: string, publicKey: ${IPublicKey}): void;
void addTrustedServer(string remoteAddress, ${IPublicKey} publicKey);
HRESULT addTrustedServer(_bstr_t remoteAddress, ${IPublicKey *#IPublicKey} publicKey);
remoteAddress
Full remote address of a server.
publicKey
Server's public key.

Adds a given server and its public key to the trusted servers database. If entry already exists, it is overwritten.

removeTrustedServer

removeTrustedServer(remoteAddress: string): void;
void removeTrustedServer(string remoteAddress);
HRESULT removeTrustedServer(string remoteAddress);
remoteAddress
Full remote address of a server.

Removes a given server from the trusted servers database.

getTrustedServerKey

getTrustedServerKey(remoteAddress: string): ${IPublicKey};
${IPublicKey} getTrustedServerKey(string remoteAddress);
${IPublicKeyPtr#IPublicKey} getTrustedServerKey(_bstr_t remoteAddress);
remoteAddress
Full server address.

Lookup a given server in the trusted servers database. If the entry is found, the server's public key is returned, otherwise, an exception is thrown.

createPublicKey

createPublicKey(base64Key: string): ${IPublicKey};
${IPublicKey} createPublicKey(string base64Key);
${IPublicKeyPtr#IPublicKey} createPublicKey(_bstr_t base64Key);
base64Key
Base-64 encoded public key.

Creates new public key object with the public key decoded from the passed Base64-encoded string.

clearDatabase

clearDatabase(): void;
void clearDatabase();
HRESULT clearDatabase();

Removes all entries from the trusted servers database.