sqlitepib

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Cert

type Cert interface {
	AsSigner() ndn.Signer
	Name() enc.Name
	Key() Key
	Data() []byte
	// KeyLocator is the name of the key/certificate which signs this certificate
	KeyLocator() enc.Name
}

Cert represents a certificate one owns

type FileTpm

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

func (*FileTpm) DeleteKey

func (tpm *FileTpm) DeleteKey(keyName enc.Name)

func (*FileTpm) GenerateKey

func (tpm *FileTpm) GenerateKey(keyName enc.Name, keyType string, keySize uint64) enc.Buffer

func (*FileTpm) GetSigner

func (tpm *FileTpm) GetSigner(keyName enc.Name, keyLocatorName enc.Name) ndn.Signer

func (*FileTpm) KeyExist

func (tpm *FileTpm) KeyExist(keyName enc.Name) bool

func (*FileTpm) ToFileName

func (tpm *FileTpm) ToFileName(keyNameBytes []byte) string

type Identity

type Identity interface {
	Name() enc.Name
	GetKey(enc.Name) Key
	FindCert(func(Cert) bool) Cert
}

Identity represents an identity one owns

type Key

type Key interface {
	Name() enc.Name
	Identity() Identity
	KeyBits() []byte
	SelfSignedCert() Cert
	GetCert(enc.Name) Cert
	FindCert(func(Cert) bool) Cert
}

Key represents a key one owns (with both private and public keybits)

type Pib

type Pib interface {
	Tpm() Tpm
	GetIdentity(name enc.Name) Identity
}

Pib is a storage storing all owned identities, keys and certificates.

type SqliteCert

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

func (*SqliteCert) AsSigner

func (cert *SqliteCert) AsSigner() ndn.Signer

func (*SqliteCert) Data

func (cert *SqliteCert) Data() []byte

func (*SqliteCert) Key

func (cert *SqliteCert) Key() Key

func (*SqliteCert) KeyLocator

func (cert *SqliteCert) KeyLocator() enc.Name

func (*SqliteCert) Name

func (cert *SqliteCert) Name() enc.Name

type SqliteIdent

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

func (*SqliteIdent) FindCert

func (iden *SqliteIdent) FindCert(check func(Cert) bool) Cert

func (*SqliteIdent) GetKey

func (iden *SqliteIdent) GetKey(keyName enc.Name) Key

func (*SqliteIdent) Name

func (iden *SqliteIdent) Name() enc.Name

type SqliteKey

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

func (*SqliteKey) FindCert

func (key *SqliteKey) FindCert(check func(Cert) bool) Cert

func (*SqliteKey) GetCert

func (key *SqliteKey) GetCert(certName enc.Name) Cert

func (*SqliteKey) Identity

func (key *SqliteKey) Identity() Identity

func (*SqliteKey) KeyBits

func (key *SqliteKey) KeyBits() []byte

func (*SqliteKey) Name

func (key *SqliteKey) Name() enc.Name

func (*SqliteKey) SelfSignedCert

func (key *SqliteKey) SelfSignedCert() Cert

type SqlitePib

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

func NewSqlitePib

func NewSqlitePib(path string, tpm Tpm) *SqlitePib

func (*SqlitePib) GetCert

func (pib *SqlitePib) GetCert(certName enc.Name) Cert

func (*SqlitePib) GetIdentity

func (pib *SqlitePib) GetIdentity(name enc.Name) Identity

func (*SqlitePib) GetKey

func (pib *SqlitePib) GetKey(keyName enc.Name) Key

func (*SqlitePib) GetSignerForCert

func (pib *SqlitePib) GetSignerForCert(certName enc.Name) ndn.Signer

func (*SqlitePib) Tpm

func (pib *SqlitePib) Tpm() Tpm

type Tpm

type Tpm interface {
	GetSigner(keyName enc.Name, keyLocatorName enc.Name) ndn.Signer
	GenerateKey(keyName enc.Name, keyType string, keySize uint64) enc.Buffer
	KeyExist(keyName enc.Name) bool
	DeleteKey(keyName enc.Name)
}

Tpm is a sceure storage that holds the private key

func NewFileTpm

func NewFileTpm(path string) Tpm

Jump to

Keyboard shortcuts

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