/// <summary> /// Sets specific client key shared as part of subscription. /// </summary> /// <param name="keyName">The key name.</param> /// <param name="key">The key.</param> public void SetKey(PushEncryptionKeyName keyName, string key) { if (Keys == null) { Keys = new Dictionary <string, string>(); } Keys[StringifyKeyName(keyName)] = key; }
/// <summary> /// Gets specific client key shared as part of subscription. /// </summary> /// <param name="keyName">The key name.</param> /// <returns>The key.</returns> public string GetKey(PushEncryptionKeyName keyName) { string key = null; if (Keys != null) { string keyNameStringified = StringifyKeyName(keyName); if (Keys.ContainsKey(keyNameStringified)) { key = Keys[keyNameStringified]; } } return(key); }
public IntPtr GetKey(PushEncryptionKeyName name) { return(this.CallMethod <IntPtr>("getKey", name)); }
private string StringifyKeyName(PushEncryptionKeyName keyName) { return(keyName.ToString().ToLowerInvariant()); }