C# Class KeePassLib.Keys.CompositeKey

Represents a key. A key can be build up using several user key data sources like a password, a key file, the currently logged on user credentials, the current computer ID, etc.
Afficher le fichier Open project: cappert/keepass2 Class Usage Examples

Méthodes publiques

Méthode Description
AddUserKey ( IUserKey pKey ) : void

/// Deconstructor, clears up the key. ///

/// Clears the key. This function also erases all previously stored /// user key data objects. ///

Add a user key.

CompositeKey ( ) : Org.BouncyCastle.Crypto

Construct a new, empty key object.

ContainsType ( Type tUserKeyType ) : bool

Test whether the composite key contains a specific type of user keys (password, key file, ...). If at least one user key of that type is present, the function returns true.

EqualsValue ( CompositeKey ckOther ) : bool
GenerateKey32 ( byte pbKeySeed32, ulong uNumRounds ) : KeePassLib.Security.ProtectedBinary

Generate a 32-bit wide key out of the composite key.

GetUserKey ( Type tUserKeyType ) : IUserKey

Get the first user key of a specified type.

RemoveUserKey ( IUserKey pKey ) : bool

Remove a user key.

TransformKeyBenchmark ( uint uMilliseconds, ulong uStep ) : ulong

Benchmark the TransformKey method. Within uMilliseconds ms, random keys will be transformed and the number of performed transformations are returned.

TransformKeyManaged ( byte pbNewKey32, byte pbKeySeed32, ulong uNumRounds ) : bool

Private Methods

Méthode Description
CreateRawCompositeKey32 ( ) : byte[]

Creates the composite key from the supplied user key sources (password, key file, user account, computer ID, etc.).

TransformKey ( byte pbOriginalKey32, byte pbKeySeed32, ulong uNumRounds ) : byte[]

Transform the current key uNumRounds times.

ValidateUserKeys ( ) : void

Method Details

AddUserKey() public méthode

/// Deconstructor, clears up the key. /// /// Clears the key. This function also erases all previously stored /// user key data objects. /// Add a user key.
public AddUserKey ( IUserKey pKey ) : void
pKey IUserKey User key to add.
Résultat void

CompositeKey() public méthode

Construct a new, empty key object.
public CompositeKey ( ) : Org.BouncyCastle.Crypto
Résultat Org.BouncyCastle.Crypto

ContainsType() public méthode

Test whether the composite key contains a specific type of user keys (password, key file, ...). If at least one user key of that type is present, the function returns true.
public ContainsType ( Type tUserKeyType ) : bool
tUserKeyType System.Type User key type.
Résultat bool

EqualsValue() public méthode

public EqualsValue ( CompositeKey ckOther ) : bool
ckOther CompositeKey
Résultat bool

GenerateKey32() public méthode

Generate a 32-bit wide key out of the composite key.
public GenerateKey32 ( byte pbKeySeed32, ulong uNumRounds ) : KeePassLib.Security.ProtectedBinary
pbKeySeed32 byte Seed used in the key transformation /// rounds. Must be a byte array containing exactly 32 bytes; must /// not be null.
uNumRounds ulong Number of key transformation rounds.
Résultat KeePassLib.Security.ProtectedBinary

GetUserKey() public méthode

Get the first user key of a specified type.
public GetUserKey ( Type tUserKeyType ) : IUserKey
tUserKeyType System.Type Type of the user key to get.
Résultat IUserKey

RemoveUserKey() public méthode

Remove a user key.
public RemoveUserKey ( IUserKey pKey ) : bool
pKey IUserKey User key to remove.
Résultat bool

TransformKeyBenchmark() public static méthode

Benchmark the TransformKey method. Within uMilliseconds ms, random keys will be transformed and the number of performed transformations are returned.
public static TransformKeyBenchmark ( uint uMilliseconds, ulong uStep ) : ulong
uMilliseconds uint Test duration in ms.
uStep ulong Stepping. /// should be a prime number. For fast processors /// (PCs) a value of 3001 is recommended, for slower processors (PocketPC) /// a value of 401 is recommended.
Résultat ulong

TransformKeyManaged() public static méthode

public static TransformKeyManaged ( byte pbNewKey32, byte pbKeySeed32, ulong uNumRounds ) : bool
pbNewKey32 byte
pbKeySeed32 byte
uNumRounds ulong
Résultat bool