crypto

package
v0.0.0-...-503c2a9 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	KeyDataTypeUnknown   = clib.KeyDataTypeUnknown
	KeyDataTypeNone      = clib.KeyDataTypeNone
	KeyDataTypePublic    = clib.KeyDataTypePublic
	KeyDataTypePrivate   = clib.KeyDataTypePrivate
	KeyDataTypeSymmetric = clib.KeyDataTypeSymmetric
	KeyDataTypeSession   = clib.KeyDataTypeSession
	KeyDataTypePermanent = clib.KeyDataTypePermanent
	KeyDataTypeTrusted   = clib.KeyDataTypeTrusted
	KeyDataTypeAny       = clib.KeyDataTypeAny
)
View Source
const (
	KeyDataFormatUnknown  = clib.KeyDataFormatUnknown
	KeyDataFormatBinary   = clib.KeyDataFormatBinary
	KeyDataFormatPem      = clib.KeyDataFormatPem
	KeyDataFormatDer      = clib.KeyDataFormatDer
	KeyDataFormatPkcs8Pem = clib.KeyDataFormatPkcs8Pem
	KeyDataFormatPkcs8Der = clib.KeyDataFormatPkcs8Der
	KeyDataFormatPkcs12   = clib.KeyDataFormatPkcs12
	KeyDataFormatCertPem  = clib.KeyDataFormatCertPem
	KeyDataFormatCertDer  = clib.KeyDataFormatCertDer
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Key

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

func LoadCertFromFile

func LoadCertFromFile(fn string, format KeyDataFormat) (*Key, error)

func LoadKeyFromBytes

func LoadKeyFromBytes(data []byte, format KeyDataFormat) (*Key, error)

func LoadKeyFromFile

func LoadKeyFromFile(file string, format KeyDataFormat) (*Key, error)

func LoadKeyFromRSAPrivateKey

func LoadKeyFromRSAPrivateKey(privkey *rsa.PrivateKey) (*Key, error)

func NewKey

func NewKey() (*Key, error)

func (*Key) Copy

func (k *Key) Copy() (*Key, error)

func (*Key) Free

func (k *Key) Free()

func (Key) HasDsaKey

func (k Key) HasDsaKey() error

func (Key) HasEcdsaKey

func (k Key) HasEcdsaKey() error

func (Key) HasRsaKey

func (k Key) HasRsaKey() error

func (Key) HasX509

func (k Key) HasX509() error

func (*Key) LoadCertFromFile

func (k *Key) LoadCertFromFile(fn string, format KeyDataFormat) error

func (Key) Pointer

func (k Key) Pointer() uintptr

type KeyDataFormat

type KeyDataFormat clib.KeyDataFormat

type KeyDataType

type KeyDataType clib.KeyDataType

type KeyManager

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

func NewKeyManager

func NewKeyManager() (*KeyManager, error)

func (*KeyManager) AdoptKey

func (km *KeyManager) AdoptKey(key *Key) error

AdoptKey adds a key to the key manager

func (*KeyManager) Free

func (km *KeyManager) Free()

func (*KeyManager) GetKey

func (km *KeyManager) GetKey(n types.Node) error

func (*KeyManager) LoadCert

func (km *KeyManager) LoadCert(buf []byte, format KeyDataFormat, typ KeyDataType) error

func (*KeyManager) LoadKeyFromRSAPrivateKey

func (km *KeyManager) LoadKeyFromRSAPrivateKey(privkey *rsa.PrivateKey) error

func (KeyManager) Pointer

func (km KeyManager) Pointer() uintptr

Jump to

Keyboard shortcuts

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