Documentation
¶
Index ¶
- Constants
- func InsertFile(kc ndn.KeyChain, content []byte) error
- func NewKeyChain(uri string, pubStore ndn.Store) (ndn.KeyChain, error)
- func NewKeyChainDir(path string, pubStore ndn.Store) (ndn.KeyChain, error)
- func NewKeyChainMem(pubStore ndn.Store) ndn.KeyChain
- type KeyChainDir
- func (kc *KeyChainDir) Identities() []ndn.KeyChainIdentity
- func (kc *KeyChainDir) IdentityByName(name enc.Name) ndn.KeyChainIdentity
- func (kc *KeyChainDir) InsertCert(wire []byte) error
- func (kc *KeyChainDir) InsertKey(signer ndn.Signer) error
- func (kc *KeyChainDir) Store() ndn.Store
- func (kc *KeyChainDir) String() string
- type KeyChainMem
- func (kc *KeyChainMem) Identities() []ndn.KeyChainIdentity
- func (kc *KeyChainMem) IdentityByName(name enc.Name) ndn.KeyChainIdentity
- func (kc *KeyChainMem) InsertCert(wire []byte) error
- func (kc *KeyChainMem) InsertKey(signer ndn.Signer) error
- func (kc *KeyChainMem) Store() ndn.Store
- func (kc *KeyChainMem) String() string
Constants ¶
const EXT_CERT = ".cert"
const EXT_KEY = ".key"
const EXT_PEM = ".pem"
Variables ¶
This section is empty.
Functions ¶
func InsertFile ¶
InsertFile inserts all signers and certs from the given content.
func NewKeyChain ¶
(AI GENERATED DESCRIPTION): Creates a new keychain instance from the given URI, selecting either an in‑memory or directory‑based implementation based on the URI scheme and attaching the supplied public key store, returning an error for unsupported schemes.
func NewKeyChainDir ¶
NewKeyChainDir creates a new in-memory keychain.
Types ¶
type KeyChainDir ¶
type KeyChainDir struct {
// contains filtered or unexported fields
}
KeyChainDir is a directory-based keychain.
func (*KeyChainDir) Identities ¶
func (kc *KeyChainDir) Identities() []ndn.KeyChainIdentity
(AI GENERATED DESCRIPTION): Returns a slice of all identities currently stored in the key‑chain directory.
func (*KeyChainDir) IdentityByName ¶
func (kc *KeyChainDir) IdentityByName(name enc.Name) ndn.KeyChainIdentity
(AI GENERATED DESCRIPTION): Retrieves and returns the identity that matches the specified name from the keychain directory’s in‑memory store.
func (*KeyChainDir) InsertCert ¶
func (kc *KeyChainDir) InsertCert(wire []byte) error
(AI GENERATED DESCRIPTION): Inserts the given certificate (in wire format) into the in‑memory key chain and writes it to disk with the certificate file extension.
func (*KeyChainDir) InsertKey ¶
func (kc *KeyChainDir) InsertKey(signer ndn.Signer) error
(AI GENERATED DESCRIPTION): Adds a signer to the in‑memory key chain and writes its secret key to disk in a file with the key extension.
func (*KeyChainDir) Store ¶
func (kc *KeyChainDir) Store() ndn.Store
(AI GENERATED DESCRIPTION): Returns the underlying in‑memory store that backs the KeyChainDir.
func (*KeyChainDir) String ¶
func (kc *KeyChainDir) String() string
(AI GENERATED DESCRIPTION): Returns a string representation of the KeyChainDir, displaying the path to the keychain directory.
type KeyChainMem ¶
type KeyChainMem struct {
// contains filtered or unexported fields
}
KeyChainMem is an in-memory keychain.
func (*KeyChainMem) Identities ¶
func (kc *KeyChainMem) Identities() []ndn.KeyChainIdentity
(AI GENERATED DESCRIPTION): Returns a slice of all identities currently stored in the in‑memory key chain.
func (*KeyChainMem) IdentityByName ¶
func (kc *KeyChainMem) IdentityByName(name enc.Name) ndn.KeyChainIdentity
(AI GENERATED DESCRIPTION): Retrieves and returns the KeyChainIdentity from the in‑memory keychain that has the specified name, or nil if no matching identity exists.
func (*KeyChainMem) InsertCert ¶
func (kc *KeyChainMem) InsertCert(wire []byte) error
(AI GENERATED DESCRIPTION): Adds a certificate to the in‑memory key chain after validating its type, format, and expiration, ensuring it is not a duplicate, storing it in the public store, and updating all identities that reference it.
func (*KeyChainMem) InsertKey ¶
func (kc *KeyChainMem) InsertKey(signer ndn.Signer) error
(AI GENERATED DESCRIPTION): Adds a signer key to the in‑memory key chain, creating its identity if needed and linking any existing certificates whose names are prefixed by the key name.
func (*KeyChainMem) Store ¶
func (kc *KeyChainMem) Store() ndn.Store
(AI GENERATED DESCRIPTION): Returns the in‑memory public‑key store associated with the KeyChainMem instance.
func (*KeyChainMem) String ¶
func (kc *KeyChainMem) String() string
(AI GENERATED DESCRIPTION): Returns the string identifier `"keychain-mem"` for the in‑memory keychain instance.