Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/keemobile/kotpass
The library offers reading and writing support for KeePass (KDBX) files in Kotlin
https://github.com/keemobile/kotpass
credential-storage credentials-management jvm kdbx kdbx-database keepass kotlin kotlin-library library password-store security-tools
Last synced: 2 months ago
JSON representation
The library offers reading and writing support for KeePass (KDBX) files in Kotlin
- Host: GitHub
- URL: https://github.com/keemobile/kotpass
- Owner: keemobile
- License: mit
- Created: 2021-07-08T18:25:36.000Z (over 3 years ago)
- Default Branch: develop
- Last Pushed: 2024-08-07T21:45:42.000Z (6 months ago)
- Last Synced: 2024-08-23T20:16:40.693Z (5 months ago)
- Topics: credential-storage, credentials-management, jvm, kdbx, kdbx-database, keepass, kotlin, kotlin-library, library, password-store, security-tools
- Language: Kotlin
- Homepage:
- Size: 586 KB
- Stars: 15
- Watchers: 3
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- awesome-keepass - kotpass - `Kotlin` Provides reading/writing support for KDBX files (versions 3.x/4.x). (API libraries / Other clients)
README
# Kotpass
![Build & Test](https://img.shields.io/github/actions/workflow/status/keemobile/kotpass/gradle.yml?label=Build%20%26%20Test)
[![](https://jitpack.io/v/keemobile/kotpass.svg)](https://jitpack.io/#keemobile/kotpass) [![codecov](https://codecov.io/gh/keemobile/kotpass/graph/badge.svg?token=59LMP3BOXJ)](https://codecov.io/gh/keemobile/kotpass) ![badge][badge-jvm][badge-jvm]: http://img.shields.io/badge/-JVM-DB413D.svg
The library offers reading and writing support for [KeePass](https://en.wikipedia.org/wiki/KeePass) (KDBX) files in Kotlin, including the latest format version 4.1. It is suitable for Mobile, Desktop, and Backend JVM projects. The functional style API makes it convenient for MVI-like architectures.
## See it in action
This library is used as backbone of [KeeMobile](https://keemobile.app) password manager, check it out:
[](https://play.google.com/store/apps/details?id=app.keemobile)
## Installation
The latest release is available on [Maven Central](https://central.sonatype.com/artifact/app.keemobile/kotpass/overview).
```kotlin
dependencies {
implementation("app.keemobile:kotpass:0.10.0")
}
```## Usage
### 🧬 [Api reference](https://keemobile.github.io/kotpass)
Reading from file:
``` kotlin
val credentials = Credentials.from(EncryptedValue.fromString("passphrase"))
val database = File("testfile.kdbx")
.inputStream()
.use { inputStream ->
KeePassDatabase.decode(inputStream, credentials)
}
```
`KeePassDatabase` is represented as immutable object, in order to alter it use a set of modifier extensions.Each time new `KeePassDatabase` object is returned:
``` kotlin
val groupUuid = UUID.fromString("c997344c-952b-e02b-06a6-29510ce71a12")
val newDatabase = database
.modifyMeta {
copy(generator = "Lorem ipsum")
}.modifyGroup(groupUuid) {
copy(name = "Hello kotpass!")
}
```