C# Class KeePassLib.Security.ProtectedString

Represents an in-memory encrypted string.
Afficher le fichier Open project: cappert/keepass2 Class Usage Examples

Méthodes publiques

Méthode Description
Insert ( int iStart, string strInsert ) : ProtectedString
ProtectedString ( ) : System

Construct a new protected string object. Protection is disabled.

ProtectedString ( bool bEnableProtection, KeePassLib.Security.XorredBuffer xbProtected ) : System

Construct a new protected string. The string is initialized to the value passed in the XorredBuffer object.

ProtectedString ( bool bEnableProtection, byte vUtf8Value ) : System

Construct a new protected string. The string is initialized to the value supplied in the parameters (UTF-8 encoded string).

ProtectedString ( bool bEnableProtection, string strValue ) : System

Construct a new protected string. The string is initialized to the value supplied in the parameters.

ReadString ( ) : string

Convert the protected string to a normal string object. Be careful with this function, the returned string object isn't protected anymore and stored in plain-text in the process memory.

ReadUtf8 ( ) : byte[]

Read out the string and return a byte array that contains the string encoded using UTF-8. The returned string is not protected anymore!

ReadXorredString ( KeePassLib.Cryptography.CryptoRandomStream crsRandomSource ) : byte[]

Read the protected string and return it protected with a sequence of bytes generated by a random stream.

Remove ( int iStart, int nCount ) : ProtectedString
WithProtection ( bool bProtect ) : ProtectedString

Private Methods

Méthode Description
Init ( bool bEnableProtection, byte pbUtf8 ) : void
Init ( bool bEnableProtection, string str ) : void

Method Details

Insert() public méthode

public Insert ( int iStart, string strInsert ) : ProtectedString
iStart int
strInsert string
Résultat ProtectedString

ProtectedString() public méthode

Construct a new protected string object. Protection is disabled.
public ProtectedString ( ) : System
Résultat System

ProtectedString() public méthode

Construct a new protected string. The string is initialized to the value passed in the XorredBuffer object.
public ProtectedString ( bool bEnableProtection, KeePassLib.Security.XorredBuffer xbProtected ) : System
bEnableProtection bool Enable protection or not.
xbProtected KeePassLib.Security.XorredBuffer XorredBuffer object containing the /// string in UTF-8 representation. The UTF-8 string must not /// be null-terminated.
Résultat System

ProtectedString() public méthode

Construct a new protected string. The string is initialized to the value supplied in the parameters (UTF-8 encoded string).
public ProtectedString ( bool bEnableProtection, byte vUtf8Value ) : System
bEnableProtection bool If this parameter is true, /// the string will be protected in memory (encrypted). If it /// is false, the string will be stored as plain-text.
vUtf8Value byte The initial string value, encoded as /// UTF-8 byte array. This parameter won't be modified; the caller /// is responsible for clearing it.
Résultat System

ProtectedString() public méthode

Construct a new protected string. The string is initialized to the value supplied in the parameters.
public ProtectedString ( bool bEnableProtection, string strValue ) : System
bEnableProtection bool If this parameter is true, /// the string will be protected in memory (encrypted). If it /// is false, the string will be stored as plain-text.
strValue string The initial string value.
Résultat System

ReadString() public méthode

Convert the protected string to a normal string object. Be careful with this function, the returned string object isn't protected anymore and stored in plain-text in the process memory.
public ReadString ( ) : string
Résultat string

ReadUtf8() public méthode

Read out the string and return a byte array that contains the string encoded using UTF-8. The returned string is not protected anymore!
public ReadUtf8 ( ) : byte[]
Résultat byte[]

ReadXorredString() public méthode

Read the protected string and return it protected with a sequence of bytes generated by a random stream.
public ReadXorredString ( KeePassLib.Cryptography.CryptoRandomStream crsRandomSource ) : byte[]
crsRandomSource KeePassLib.Cryptography.CryptoRandomStream Random number source.
Résultat byte[]

Remove() public méthode

public Remove ( int iStart, int nCount ) : ProtectedString
iStart int
nCount int
Résultat ProtectedString

WithProtection() public méthode

public WithProtection ( bool bProtect ) : ProtectedString
bProtect bool
Résultat ProtectedString