1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
|
Source: golang-github-mikesmitty-edkey
Section: golang
Priority: optional
Maintainer: Debian Go Packaging Team <team+pkg-go@tracker.debian.org>
Uploaders: Patrick O'Doherty <p@trickod.com>,
Anthony Fok <foka@debian.org>,
Rules-Requires-Root: no
Build-Depends: debhelper-compat (= 13),
dh-sequence-golang,
golang-any,
golang-golang-x-crypto-dev
Testsuite: autopkgtest-pkg-go
Standards-Version: 4.6.0
Vcs-Browser: https://salsa.debian.org/go-team/packages/golang-github-mikesmitty-edkey
Vcs-Git: https://salsa.debian.org/go-team/packages/golang-github-mikesmitty-edkey.git
Homepage: https://github.com/mikesmitty/edkey
XS-Go-Import-Path: github.com/mikesmitty/edkey
Package: golang-github-mikesmitty-edkey-dev
Architecture: all
Multi-Arch: foreign
Depends: golang-golang-x-crypto-dev,
${misc:Depends}
Description: generates ED25519 private keys in the OpenSSH private key format (Go library)
Go package edkey allows you to marshal/write ED25519 private keys
in the OpenSSH private key format.
.
Example:
.
package main
.
import (
"crypto/rand"
"encoding/pem"
"io/ioutil"
"github.com/mikesmitty/edkey"
"golang.org/x/crypto/ed25519"
"golang.org/x/crypto/ssh"
)
.
func main() {
// Generate a new private/public keypair for OpenSSH
pubKey, privKey, _ := ed25519.GenerateKey(rand.Reader)
publicKey, _ := ssh.NewPublicKey(pubKey)
.
pemKey := &pem.Block{
Type: "OPENSSH PRIVATE KEY",
Bytes: edkey.MarshalED25519PrivateKey(privKey),
}
privateKey := pem.EncodeToMemory(pemKey)
authorizedKey := ssh.MarshalAuthorizedKey(publicKey)
.
_ = ioutil.WriteFile("id_ed25519", privateKey, 0600)
_ = ioutil.WriteFile("id_ed25519.pub", authorizedKey, 0644)
}
|