tobischo / gokeepasslib

A library to read and write keepass 2 files written in go
MIT License
244 stars 30 forks source link

Get reference from entry #89

Open hba opened 2 years ago

hba commented 2 years ago

Hello,

I use the Reference in my keepass and I can't display the content.

Is there a way to follow, and display the reference directly ?

fmt.Println(entry.GetTitle())

return :

fmt.Println({REF:P@I:BE8116351FDF544E8BC5708C777E3E73})

thanks

tobischo commented 2 years ago

Hi @hba, I am not entirely sure which reference you are referring to. If this is what your example returns, then that is what is defined as title and what is visible as entry title.

The value itself is stored in the values list https://github.com/tobischo/gokeepasslib/blob/ff48262307bc7babcbafd30a151caec582b83abf/entry.go#L27 in the entry: https://github.com/tobischo/gokeepasslib/blob/ff48262307bc7babcbafd30a151caec582b83abf/entry.go#L112

What specific keepass implementation are you using that returns this reference?

gokeepasslib is just a library which allows reading and writing keepass files. The goal is explicitly not to provide the convenience functions that a UI application would offer. That is up to the implementer to define how they would like their tool to behave.

hba commented 2 years ago

Hi @tobischo,

Thank you for the quick reply.

I migrate a python application, in python I used this function:

https://github.com/libkeepass/pykeepass/blob/e0d86b6880bf96ff6873889c453cb3d2168c999a/pykeepass/pykeepass.py#L657

tobischo commented 2 years ago

As of right now, that is not supported and you would have to parse and look the value behind it up yourself

I think I never used that feature in keepass itself, so in order to implement that I would need an example keepass file

hba commented 2 years ago

here is an example with a keepass file with an entry "foo" which refers to a password "bar". I put the python example and the golang example:

https://github.com/hba/keepass_test/