sign

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: May 6, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MagicHeader          = "SSHSIG"
	DefaultHashAlgorithm = "sha512"
	Namespace            = "git"
)

Variables

This section is empty.

Functions

func Armor added in v1.1.0

func Armor(sshSig *ssh.Signature, pubKey ssh.PublicKey) []byte

Create an Armored (PEM) Signature

func NewSignature added in v1.1.0

func NewSignature(signer ssh.AlgorithmSigner, data io.Reader) (*ssh.Signature, error)

Create a signature for the given data using the given signer.

func SignCommit

func SignCommit(sshPrivateKey string, passphrase string, data io.Reader) ([]byte, error)

Sign a commit(data) using the given private key.

Types

type MessageWrapper

type MessageWrapper struct {
	Namespace     string
	Reserved      string
	HashAlgorithm string
	Hash          string
}

https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.sshsig#L81

type WrappedSig

type WrappedSig struct {
	MagicHeader   [6]byte
	Version       uint32
	PublicKey     string
	Namespace     string
	Reserved      string
	HashAlgorithm string
	Signature     string
}

https://github.com/openssh/openssh-portable/blob/master/PROTOCOL.sshsig#L34

Jump to

Keyboard shortcuts

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