https://github.com/joshdk/ykmango
🔑 Prompt a YubiKey device to generate an OATH code
https://github.com/joshdk/ykmango
golang yubico yubikey
Last synced: 2 months ago
JSON representation
🔑 Prompt a YubiKey device to generate an OATH code
- Host: GitHub
- URL: https://github.com/joshdk/ykmango
- Owner: joshdk
- License: mit
- Created: 2017-10-22T22:19:15.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-08-26T17:06:55.000Z (almost 7 years ago)
- Last Synced: 2025-03-27T20:12:27.449Z (3 months ago)
- Topics: golang, yubico, yubikey
- Language: Go
- Size: 63.5 KB
- Stars: 15
- Watchers: 2
- Forks: 3
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
[](https://opensource.org/licenses/MIT)
[](https://godoc.org/github.com/joshdk/ykmango)
[](https://goreportcard.com/report/github.com/joshdk/ykmango)
[](https://circleci.com/gh/joshdk/ykmango/tree/master)
[](https://codecov.io/gh/joshdk/ykmango)# YKManGo
🔑 Prompt a [YubiKey device](https://en.wikipedia.org/wiki/YubiKey) to generate an OATH code
## Installing
You can fetch this library by running the following
go get -u github.com/joshdk/ykmango
Additionally, this library has a runtime dependency on [`ykman`](https://github.com/Yubico/yubikey-manager/tree/master/ykman) which must [be installed](https://developers.yubico.com/yubikey-manager/) before use.## Usage
```go
import (
"fmt"
"github.com/joshdk/ykmango"
)// List the currently configured OATH slot names.
names, err := ykman.List()
if err != nil {
panic(err.Error())
}for _, name := range names {
fmt.Printf("Found code named: %s\n", name)
// Found code named: aws-mfa
}// Generate an OATH code using the given slot name.
// You may need to touch your YubiKey device if the
// slot is configured to require touch.
code, err := ykman.Generate("aws-mfa")
if err != nil {
panic(err.Error())
}fmt.Printf("Your code is: %s\n", code)
// Your code is: 150509
```## License
This library is distributed under the [MIT License](https://opensource.org/licenses/MIT), see LICENSE.txt for more information.