This interface is implemented by a trusted servers database object. An instance of this object is obtained using the IUsbClient.trustedServersDb property.
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}();
};
// 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.
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.
addTrustedServer(remoteAddress: string, publicKey: ${IPublicKey}): void;
void addTrustedServer(string remoteAddress, ${IPublicKey} publicKey);
HRESULT addTrustedServer(_bstr_t remoteAddress, ${IPublicKey *#IPublicKey} publicKey);
remoteAddress
publicKey
Adds a given server and its public key to the trusted servers database. If entry already exists, it is overwritten.
removeTrustedServer(remoteAddress: string): void;
void removeTrustedServer(string remoteAddress);
HRESULT removeTrustedServer(string remoteAddress);
remoteAddress
Removes a given server from the trusted servers database.
getTrustedServerKey(remoteAddress: string): ${IPublicKey};
${IPublicKey} getTrustedServerKey(string remoteAddress);
${IPublicKeyPtr#IPublicKey} getTrustedServerKey(_bstr_t remoteAddress);
remoteAddress
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(base64Key: string): ${IPublicKey};
${IPublicKey} createPublicKey(string base64Key);
${IPublicKeyPtr#IPublicKey} createPublicKey(_bstr_t base64Key);
base64Key
Creates new public key object with the public key decoded from the passed Base64-encoded string.
clearDatabase(): void;
void clearDatabase();
HRESULT clearDatabase();
Removes all entries from the trusted servers database.