/// <summary>
        /// Decrypts the Data into a string
        /// </summary>
        /// <param name="locked">locked Data to be decrypted</param>
        public byte[] UnlockBytes(ILocked locked)
        {
            if (locked == null)
            {
                throw new ArgumentNullException(nameof(locked));
            }

            return(SecretKeyBox_AES.Open(locked.Ciphertext, locked.Nonce, key));
        }
        /// <summary>
        /// Decrypts the Data into a string
        /// </summary>
        /// <param name="locked">locked Data to be decrypted</param>
        public string UnlockString(ILocked locked)
        {
            var tmp = UnlockBytes(locked);

            return(Secure.Encode(tmp));
        }
Beispiel #3
0
 public void AddLockedObject(ILocked item)
 {
     doors.Add(item);
 }