Documentation ¶
Overview ¶
Package keychain implements signing and verification on NDN packets.
Index ¶
- Variables
- func IsCertName(name ndn.Name) bool
- func IsCertificate(data ndn.Data) bool
- func IsKeyName(name ndn.Name) bool
- func ToCertName(input ndn.Name) ndn.Name
- func ToKeyName(input ndn.Name) ndn.Name
- func ToSubjectName(input ndn.Name) ndn.Name
- type PrivateKey
- type PrivateKeyKeyLocatorChanger
- type PublicKey
Constants ¶
This section is empty.
Variables ¶
var ( ComponentKEY = ndn.ParseNameComponent("KEY") ComponentSelfIssuer = ndn.ParseNameComponent("self") ComponentDefaultIssuer = ndn.ParseNameComponent("ndn-dpdk.go") )
Name components for certificate naming.
var ( ErrKeyName = errors.New("bad key name") ErrCertName = errors.New("bad certificate name") )
Error conditions for certificate naming.
Functions ¶
func IsCertName ¶
func IsCertName(name ndn.Name) bool
IsCertName determines if the input is a certificate name.
func IsCertificate ¶
func IsCertificate(data ndn.Data) bool
IsCertificate determines if the Data packet is a certificate.
func IsKeyName ¶
func IsKeyName(name ndn.Name) bool
IsKeyName determines if the input is a key name.
func ToCertName ¶
func ToCertName(input ndn.Name) ndn.Name
ToCertName extracts or builds certificate name from subject name, key name, or certificate name. If the input is a subject name, the keyID component is randomly generated. If the input is a subject name or key name, the issuerID is set to 'ndn-dpdk.go', and the version component is randomly generated.
func ToKeyName ¶
func ToKeyName(input ndn.Name) ndn.Name
ToKeyName extracts or builds key name from subject name, key name, or certificate name. If the input is a subject name, the keyID component is randomly generated.
func ToSubjectName ¶
func ToSubjectName(input ndn.Name) ndn.Name
ToSubjectName extracts subject name from subject name, key name, or certificate name.
Types ¶
type PrivateKey ¶
type PrivateKey interface {
ndn.Signer
Name() ndn.Name
}
PrivateKey represents a named private key.
type PrivateKeyKeyLocatorChanger ¶
type PrivateKeyKeyLocatorChanger interface { PrivateKey // WithKeyLocator creates a new Signer that uses a different KeyLocator. // This may be used to put certificate name in KeyLocator. WithKeyLocator(klName ndn.Name) ndn.Signer }
PrivateKeyKeyLocatorChanger is a PrivateKey that can change KeyLocator.