adTempus API
ArcanaDevelopment.adTempus.Shared Namespace / SecureStringDecryptor Class
Members Example

In This Topic
    SecureStringDecryptor Class
    In This Topic
    This class assists the use of System.Security.SecureString instances.
    Syntax
    'Declaration
     
    
    Public Class SecureStringDecryptor 
       Inherits System.Runtime.ConstrainedExecution.CriticalFinalizerObject
    Remarks
    Normally, the content of a System.Security.SecureString instance can only be read in unmnanaged code. This class decrypts the contents of a SecureString to a System.Byte array, which is pinned in memory until it is released. When the dispose method is called, the array is zeroed-out.
    Example
    You should use this class like in this example, and only for the shortest period of time necessary:
    Rijndael aes = Rijndael.Create();
    DeriveBytes db;
    using (SecureStringDecryptor helper = new SecureStringDecryptor(secretString)) {
        db = new Rfc2898DeriveBytes(helper.Password, salt, 1024);
    }
    ICryptoTransform transform = aes.CreateEncryptor(db.GetBytes(16), aes.GenerateIV());
    Inheritance Hierarchy

    System.Object
       System.Runtime.ConstrainedExecution.CriticalFinalizerObject
          ArcanaDevelopment.adTempus.Shared.SecureStringDecryptor

    See Also