cryptoutil

package
v0.0.0-...-19babe2 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2021 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenRandomString

func GenRandomString() (string, error)

GenRandomString returns 32 bytes of random string encoded with URL base64 encoding

func VerifyChallengeResponseSignature

func VerifyChallengeResponseSignature(sshCert *ssh.Certificate,
	signatureFormat string,
	signatureBlob []byte, clientNonce,
	challenge string,
	hostname string) error

VerifyChallengeResponseSignature validates that the signature of a blob is actually signed by the corresponding certificate. Does NOT do and checks on the certificate.

func WithAgentGenerateChallengeResponseSignature

func WithAgentGenerateChallengeResponseSignature(clientNonce string,
	challenge string,
	hostname string,
	agentClient agent.Agent,
	key *agent.Key) (*ssh.Signature, error)

WithAgentGenerateChallengeResponseSignature generates, given the client parameters, a valid ssh signature that can be latter used to sing messages back to the server

func WithCertAndPrivateKeyGenerateChallengeResponseSignature

func WithCertAndPrivateKeyGenerateChallengeResponseSignature(nonce1 string,
	challenge string,
	hostname string,
	certificate *ssh.Certificate,
	privateKey interface{}) (*ssh.Signature, error)

WithCertAndPrivateKeyGenerateChallengeResponseSignature generates similar to WithAgentGenerateChallengeResponseSignature but instead of an agent uses an explicit certifiate and keu

Types

This section is empty.

Jump to

Keyboard shortcuts

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