encoder

package
v0.0.0-...-a0ddc14 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PEMDecode

func PEMDecode(data []byte) ([]byte, []byte)

func PEMEncode

func PEMEncode(name string, data []byte) []byte

func PEMTryDecode

func PEMTryDecode(data []byte) ([]byte, []byte)

func ReadRSAKey

func ReadRSAKey(filename string) (*rsa.PrivateKey, *rsa.PublicKey, error)

Types

type Container

type Container struct {
	// contains filtered or unexported fields
}

func NewDERContainer

func NewDERContainer(data []byte) (*Container, error)

func NewECDSAPrivateKeyContainer

func NewECDSAPrivateKeyContainer(key *ecdsa.PrivateKey) *Container

func NewECDSAPublicKeyContainer

func NewECDSAPublicKeyContainer(key *ecdsa.PublicKey) *Container

func NewRSAPrivateKeyContainer

func NewRSAPrivateKeyContainer(key *rsa.PrivateKey) *Container

func NewRSAPublicKeyContainer

func NewRSAPublicKeyContainer(key *rsa.PublicKey) *Container

func ParseContainerChain

func ParseContainerChain(data []byte) (*Container, error)

func ParseContainerChainFromFile

func ParseContainerChainFromFile(filename string) (*Container, error)

func (*Container) Certificate

func (c *Container) Certificate() *x509.Certificate

func (*Container) CertificateRequest

func (c *Container) CertificateRequest() *x509.CertificateRequest

func (*Container) ECDSAPrivateKey

func (c *Container) ECDSAPrivateKey() *ecdsa.PrivateKey

func (*Container) ECDSAPublicKey

func (c *Container) ECDSAPublicKey() *ecdsa.PublicKey

func (*Container) FirstPrivateKey

func (c *Container) FirstPrivateKey() crypto.PrivateKey

func (*Container) FirstPublicKey

func (c *Container) FirstPublicKey() crypto.PublicKey

func (*Container) KeyType

func (c *Container) KeyType() KeyType

func (*Container) KeyTypeString

func (c *Container) KeyTypeString() string

func (*Container) Next

func (c *Container) Next() *Container

func (*Container) PrivateKey

func (c *Container) PrivateKey() crypto.PrivateKey

func (*Container) PublicKey

func (c *Container) PublicKey() crypto.PublicKey

func (*Container) RSAPrivateKey

func (c *Container) RSAPrivateKey() *rsa.PrivateKey

func (*Container) RSAPublicKey

func (c *Container) RSAPublicKey() *rsa.PublicKey

type KeyFileFormat

type KeyFileFormat int
const (
	KeyFileFormatInvalid KeyFileFormat = iota
	KeyFileFormatPKCS1RSAPrivateKey
	KeyFileFormatPKCS1RSAPublicKey
	KeyFileFormatPKCS7Message
	KeyFileFormatPKCS8PrivateKey
	KeyFileFormatPKIXPublicKey
	KeyFileFormatECPrivateKey
	KeyFileFormatECPublicKey
	KeyFileFormatECParameters
	KeyFileFormatCertificate
	KeyFileFormatCertificateRequest
	KeyFileFormatPEM
)

func TypeDetect

func TypeDetect(data []byte) []KeyFileFormat

func (KeyFileFormat) String

func (f KeyFileFormat) String() string

type KeyType

type KeyType int
const (
	KeyTypeInvalid KeyType = iota
	KeyTypeRSAPrivateKey
	KeyTypeRSAPublicKey
	KeyTypeECPrivateKey
	KeyTypeECPublicKey
	KeyTypeECParameters
	KeyTypeCertificate
	KeyTypeCertificateRequest
)

func (KeyType) String

func (t KeyType) String() string

Jump to

Keyboard shortcuts

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