gitsshkey

package
v0.13.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 20, 2022 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Generate

func Generate(algo Algorithm) (privateKey string, publicKey string, err error)

Generate creates a private key in the OpenSSH PEM format and public key in the authorized key format.

func MarshalED25519PrivateKey

func MarshalED25519PrivateKey(key ed25519.PrivateKey) ([]byte, error)

Types

type Algorithm

type Algorithm string
const (
	// AlgorithmEd25519 is the Edwards-curve Digital Signature Algorithm using Curve25519
	AlgorithmEd25519 Algorithm = "ed25519"
	// AlgorithmECDSA is the Digital Signature Algorithm (DSA) using NIST Elliptic Curve
	AlgorithmECDSA Algorithm = "ecdsa"
	// AlgorithmRSA4096 is the venerable Rivest-Shamir-Adleman algorithm
	// and creates a key with a fixed size of 4096-bit.
	AlgorithmRSA4096 Algorithm = "rsa4096"
)

func ParseAlgorithm

func ParseAlgorithm(t string) (Algorithm, error)

ParseAlgorithm returns a valid Algorithm or error if input is not a valid.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL