示例#1
0
        /// <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;
        }
示例#2
0
        /// <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);
        }
示例#3
0
 public IntPtr GetKey(PushEncryptionKeyName name)
 {
     return(this.CallMethod <IntPtr>("getKey", name));
 }
示例#4
0
 private string StringifyKeyName(PushEncryptionKeyName keyName)
 {
     return(keyName.ToString().ToLowerInvariant());
 }