sign

package
v2.41.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PKCS1PrivkeyPreamble = "RSA PRIVATE KEY"
	PKCS8PrivkeyPreamble = "PRIVATE KEY"
)

Variables

This section is empty.

Functions

func PGPArmoredDetachSign

func PGPArmoredDetachSign(message io.Reader, keyFile, passphrase string) ([]byte, error)

PGPArmoredDetachSign creates an ASCII-armored detached signature.

func PGPArmoredDetachSignWithKeyID added in v2.4.0

func PGPArmoredDetachSignWithKeyID(message io.Reader, keyFile, passphrase string, hexKeyID *string) ([]byte, error)

PGPArmoredDetachSignWithKeyID creates an ASCII-armored detached signature.

func PGPClearSignWithKeyID added in v2.16.0

func PGPClearSignWithKeyID(message io.Reader, keyFile, passphrase string, hexKeyID *string) ([]byte, error)

func PGPReadMessage added in v2.16.0

func PGPReadMessage(message []byte, armoredPubKeyFile string) (plaintext []byte, err error)

func PGPSignerWithKeyID added in v2.4.0

func PGPSignerWithKeyID(keyFile, passphrase string, hexKeyID *string) func([]byte) ([]byte, error)

PGPSignerWithKeyID returns a PGP signer that creates a detached non-ASCII-armored signature and is compatible with rpmpack's signature API.

func PGPVerify

func PGPVerify(message io.Reader, signature []byte, armoredPubKeyFile string) error

PGPVerify is exported for use in tests and verifies an ASCII-armored or non-ASCII-armored signature using an ASCII-armored or non-ASCII-armored public key file. The signer identity is not explicitly checked, other that the obvious fact that the signer's key must be in the armoredPubKeyFile.

func RSASignSHA1Digest

func RSASignSHA1Digest(sha1Digest []byte, keyFile, passphrase string) ([]byte, error)

RSASignSHA1Digest signs the provided SHA1 message digest. The key file must be in the PEM format and can either be encrypted or not.

func RSAVerifySHA1Digest

func RSAVerifySHA1Digest(sha1Digest, signature []byte, publicKeyFile string) error

RSAVerifySHA1Digest is exported for use in tests and verifies a signature over the provided SHA1 hash of a message. The key file must be in the PEM format.

Types

This section is empty.

Jump to

Keyboard shortcuts

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