C# Класс KeePassLib.Security.ProtectedString

Represents an in-memory encrypted string.
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
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

Приватные методы

Метод Описание
Init ( bool bEnableProtection, byte pbUtf8 ) : void
Init ( bool bEnableProtection, string str ) : void

Описание методов

Insert() публичный Метод

public Insert ( int iStart, string strInsert ) : ProtectedString
iStart int
strInsert string
Результат ProtectedString

ProtectedString() публичный Метод

Construct a new protected string object. Protection is disabled.
public ProtectedString ( ) : System
Результат System

ProtectedString() публичный Метод

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.
Результат System

ProtectedString() публичный Метод

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.
Результат System

ProtectedString() публичный Метод

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.
Результат System

ReadString() публичный Метод

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
Результат string

ReadUtf8() публичный Метод

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[]
Результат byte[]

ReadXorredString() публичный Метод

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.
Результат byte[]

Remove() публичный Метод

public Remove ( int iStart, int nCount ) : ProtectedString
iStart int
nCount int
Результат ProtectedString

WithProtection() публичный Метод

public WithProtection ( bool bProtect ) : ProtectedString
bProtect bool
Результат ProtectedString