crypto

package
v0.16.2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2023 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const SshKeySize = 4096

SshKeysize is the key size used when calling NewSshKeyPair().

Variables

This section is empty.

Functions

func NewSshKeyPair added in v0.8.0

func NewSshKeyPair(privateOut, publicOut io.Writer) error

NewSshKeyPair creates an RSA public key pair and writes each part to privateOut and publicOut. The output written to privateOut and pulicKeyOut is formatted as ssh-keygen would format keys. The private key part is PEM encoded with the key data formatted in PKCS1, ASN.1 DER as typically done by the ssh-keygen GNU tool. The public key is formatted as an SSH Authorized Key suitable for storing on servers.

func NewSshKeyPairUsingFileWriter added in v0.8.0

func NewSshKeyPairUsingFileWriter(writer filewriter.FileWriter, privateKeyFilename, publicKeyFilename string) (string, []byte, error)

NewSshKeyPairUsingFileWriter provides a mechanism for generating SSH key pairs and writing them to the writer direcftory context. It exists to create compatibility with filewriter.FileWriter and compliment older code. The string returned is a path to the private key written to disk using writer. The bytes returned are the public key formated as specified in NewSshKeyPair().

func SecureCipherSuitesString added in v0.7.0

func SecureCipherSuitesString() string

Types

type CertificateGenerator added in v0.6.0

type CertificateGenerator interface {
	GenerateIamAuthSelfSignCertKeyPair() ([]byte, []byte, error)
}

func NewCertificateGenerator added in v0.6.0

func NewCertificateGenerator() CertificateGenerator

type DefaultTlsValidator added in v0.6.0

type DefaultTlsValidator struct{}

func (*DefaultTlsValidator) IsSignedByUnknownAuthority added in v0.11.0

func (tv *DefaultTlsValidator) IsSignedByUnknownAuthority(host, port string) (bool, error)

IsSignedByUnknownAuthority determines if the url is signed by an unknown authority.

func (*DefaultTlsValidator) ValidateCert added in v0.6.0

func (tv *DefaultTlsValidator) ValidateCert(host, port, caCertContent string) error

ValidateCert parses the cert, ensures that the cert format is valid and verifies that the cert is valid for the url.

type TlsValidator added in v0.6.0

type TlsValidator interface {
	ValidateCert(host, port, caCertContent string) error
	IsSignedByUnknownAuthority(host, port string) (bool, error)
}

func NewTlsValidator added in v0.6.0

func NewTlsValidator() TlsValidator

Directories

Path Synopsis
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

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