keyring

package
v0.0.0-...-a555a5b Latest Latest
Warning

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

Go to latest
Published: Mar 16, 2023 License: Apache-2.0, Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

keyring provides utilities for loading and using crypto keys in different formats

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

type Key interface {
	Comment() string
	IsPrivate() bool
	JWASignatureAlgorithm() (jwa.SignatureAlgorithm, error)
	JWK() jwk.Key
	JWKThumbprintSHA256() (string, error)
	JWKThumbprintURI() (string, error)
	PublicKey() (Key, error)
	Raw() (interface{}, error)
	SignJWT(jwt.Token) ([]byte, error)
	SignJWTWithAgent(agent.ExtendedAgent, jwt.Token) ([]byte, error)
	SSHFingerprintSHA256() (string, error)
	SSHPublicKey() (ssh.PublicKey, error)
}

func From

func From(raw interface{}) (Key, error)

From creates a Key from go crypto/* types

func Open

func Open(path string) (Key, error)

Open reads a key from file, returning a Key

func OpenWithPassphrase

func OpenWithPassphrase(path string, passphrase []byte) (Key, error)

Open reads a key from file using the provided passphrase, returning a Key

func Parse

func Parse(bytes []byte) (Key, error)

Parse parses raw key bytes

func ParseString

func ParseString(s string) (Key, error)

ParseString is a shortcut for calling Parse with a string

func ParseWithPassphrase

func ParseWithPassphrase(bytes []byte, passphrase []byte) (Key, error)

Parse parses raw key bytes using the provided passphrase

Jump to

Keyboard shortcuts

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