crypto

package
v0.0.4-beta Latest Latest
Warning

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

Go to latest
Published: Oct 19, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildCertificateChain

func BuildCertificateChain(ca_path string, certificate []byte, subordinate_ca []byte) (*bytes.Buffer, *bytes.Buffer, *bytes.Buffer, error)

func GetSubordinateCaParameters

func GetSubordinateCaParameters(service string) (*types.CertificateAuthority, error)

func GetSubordinateCaPath

func GetSubordinateCaPath(service string) (*string, *string, error)

func ReturnPrivateKey

func ReturnPrivateKey(key types.AsymmetricKey) (any, error)

func WriteKeyToFile

func WriteKeyToFile(service string, privateKey types.AsymmetricKey) error

Types

type CSRGenerator

type CSRGenerator interface {
	Generate() (crypto.PrivateKey, error)
	KeyType() string
	MarshalPrivateKey(key crypto.PrivateKey) ([]byte, error)
	SupportsPublicKeyAlgorithm(algorithm x509.PublicKeyAlgorithm) bool
	SupportsSigningAlgorithm(algorithm x509.SignatureAlgorithm) bool
	SupportsKeySize(size int) bool
}

type ECDSA

type ECDSA struct {
	PublicKey  *ecdsa.PublicKey
	PrivateKey *ecdsa.PrivateKey
}

func (*ECDSA) KeyPair

func (key *ECDSA) KeyPair() any

func (*ECDSA) Sign

func (key *ECDSA) Sign(data []byte) ([]byte, error)

type RSA

type RSA struct {
	PublicKey  *rsa.PublicKey
	PrivateKey *rsa.PrivateKey
}

func (*RSA) KeyPair

func (key *RSA) KeyPair() any

func (*RSA) Sign

func (key *RSA) Sign(data []byte) ([]byte, error)

type SigningRequestGeneratorECDSA

type SigningRequestGeneratorECDSA struct {
	Curve int
}

func (*SigningRequestGeneratorECDSA) Generate

ECDSA Interface

func (*SigningRequestGeneratorECDSA) KeyType

func (e *SigningRequestGeneratorECDSA) KeyType() string

func (*SigningRequestGeneratorECDSA) MarshalPrivateKey

func (e *SigningRequestGeneratorECDSA) MarshalPrivateKey(key crypto.PrivateKey) ([]byte, error)

func (*SigningRequestGeneratorECDSA) SupportsKeySize

func (e *SigningRequestGeneratorECDSA) SupportsKeySize(size int) bool

func (*SigningRequestGeneratorECDSA) SupportsPublicKeyAlgorithm

func (e *SigningRequestGeneratorECDSA) SupportsPublicKeyAlgorithm(algorithm x509.PublicKeyAlgorithm) bool

func (*SigningRequestGeneratorECDSA) SupportsSigningAlgorithm

func (e *SigningRequestGeneratorECDSA) SupportsSigningAlgorithm(algorithm x509.SignatureAlgorithm) bool

type SigningRequestGeneratorRSA

type SigningRequestGeneratorRSA struct {
	Size int
}

func (*SigningRequestGeneratorRSA) Generate

RSA Interface

func (*SigningRequestGeneratorRSA) KeyType

func (r *SigningRequestGeneratorRSA) KeyType() string

func (*SigningRequestGeneratorRSA) MarshalPrivateKey

func (r *SigningRequestGeneratorRSA) MarshalPrivateKey(key crypto.PrivateKey) ([]byte, error)

func (*SigningRequestGeneratorRSA) SupportsKeySize

func (r *SigningRequestGeneratorRSA) SupportsKeySize(size int) bool

func (*SigningRequestGeneratorRSA) SupportsPublicKeyAlgorithm

func (r *SigningRequestGeneratorRSA) SupportsPublicKeyAlgorithm(algorithm x509.PublicKeyAlgorithm) bool

func (*SigningRequestGeneratorRSA) SupportsSigningAlgorithm

func (r *SigningRequestGeneratorRSA) SupportsSigningAlgorithm(algorithm x509.SignatureAlgorithm) bool

Jump to

Keyboard shortcuts

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