|
@@ -117,6 +117,7 @@ Type
|
|
class function TryParseEncryptedKey(const AKeyText, AKeyPassword : AnsiString; out AKey : TECPrivateKey) : boolean;
|
|
class function TryParseEncryptedKey(const AKeyText, AKeyPassword : AnsiString; out AKey : TECPrivateKey) : boolean;
|
|
class function TryParseRawKey(const ARawBytes : TRawBytes; AEncryptionTypeNID : Word; out AKey : TECPrivateKey) : boolean;
|
|
class function TryParseRawKey(const ARawBytes : TRawBytes; AEncryptionTypeNID : Word; out AKey : TECPrivateKey) : boolean;
|
|
class function TryParseHexKey(const AHexString : AnsiString; AEncryptionTypeNID : Word; out AKey : TECPrivateKey) : boolean;
|
|
class function TryParseHexKey(const AHexString : AnsiString; AEncryptionTypeNID : Word; out AKey : TECPrivateKey) : boolean;
|
|
|
|
+ class function GetKeyNameOrDefault(const AKey: TAccountKey) : AnsiString;
|
|
end;
|
|
end;
|
|
|
|
|
|
Const CT_TWalletKey_NUL : TWalletKey = (Name:'';AccountKey:(EC_OpenSSL_NID:0;x:'';y:'');CryptedKey:'';PrivateKey:Nil;SearchableAccountKey:'');
|
|
Const CT_TWalletKey_NUL : TWalletKey = (Name:'';AccountKey:(EC_OpenSSL_NID:0;x:'';y:'');CryptedKey:'';PrivateKey:Nil;SearchableAccountKey:'');
|
|
@@ -786,6 +787,20 @@ begin
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
|
|
|
|
+class function TWallet.GetKeyNameOrDefault(const AKey: TAccountKey) : AnsiString;
|
|
|
|
+var
|
|
|
|
+ LIndex : Integer;
|
|
|
|
+ LKey : TWalletKey;
|
|
|
|
+begin
|
|
|
|
+ LIndex := Self.Keys.IndexOfAccountKey(AKey);
|
|
|
|
+ if LIndex >= 0 then begin
|
|
|
|
+ LKey := Self.Keys[LIndex];
|
|
|
|
+ Result := LKey.Name;
|
|
|
|
+ if LKey.HasPrivateKey then
|
|
|
|
+ Result := Result + ' (*)';
|
|
|
|
+ end else Result := TAccountComp.AccountPublicKeyExport(AKey);
|
|
|
|
+end;
|
|
|
|
+
|
|
class procedure TWallet.CheckLoaded;
|
|
class procedure TWallet.CheckLoaded;
|
|
begin
|
|
begin
|
|
if not Assigned(FKeys) then
|
|
if not Assigned(FKeys) then
|