Documentation
¶
Index ¶
- Constants
- func CertIsExpired(cert ndn.Data) bool
- func DecodeFile(content []byte) (signers []ndn.Signer, certs [][]byte, err error)
- func GetIdentityFromCertName(name enc.Name) (enc.Name, error)
- func GetIdentityFromKeyName(name enc.Name) (enc.Name, error)
- func GetKeyNameFromCertName(name enc.Name) (enc.Name, error)
- func MakeCertName(keyName enc.Name, issuerId enc.Component, version uint64) (enc.Name, error)
- func MakeKeyName(name enc.Name) enc.Name
- func PemDecode(str []byte) [][]byte
- func PemEncode(raw []byte) ([]byte, error)
- func SelfSign(args SignCertArgs) (enc.Wire, error)
- func SignCert(args SignCertArgs) (enc.Wire, error)
- type SignCertArgs
- type TrustConfig
- type TrustConfigValidateArgs
Constants ¶
const PEM_HEADER_KEY = "SignerKey"
const PEM_HEADER_NAME = "Name"
const PEM_HEADER_SIGTYPE = "SigType"
const PEM_HEADER_VALIDITY = "Validity"
const PEM_TYPE_CERT = "NDN CERT"
const PEM_TYPE_SECRET = "NDN KEY"
Variables ¶
This section is empty.
Functions ¶
func CertIsExpired ¶ added in v1.4.3
func DecodeFile ¶ added in v1.4.3
DecodeFile decodes all signers and certs from the given content. The input can either be TLV or PEM encoded. If PEM encoded, the input may have more than one signers and/or certs. May return empty slices for signers and certs if no valid entries.
func GetIdentityFromCertName ¶ added in v1.5.0
GetIdentityFromCertName extracts the identity name from a certificate name.
func GetIdentityFromKeyName ¶ added in v1.4.3
GetIdentityFromKeyName extracts the identity name from a key name.
func GetKeyNameFromCertName ¶ added in v1.4.3
GetKeyNameFromCertName extracts the key name from a certificate name.
func MakeCertName ¶ added in v1.4.3
MakeCertName generates a new certificate name for a given key name.
func MakeKeyName ¶ added in v1.4.3
MakeKeyName generates a new key name for a given identity.
func PemEncode ¶ added in v1.4.3
PemEncode converts an NDN data to a text representation following RFC 7468.
Types ¶
type SignCertArgs ¶ added in v1.4.3
type SignCertArgs struct { // Signer is the private key used to sign the certificate. Signer ndn.Signer // Data is the CSR or Key to be signed. Data ndn.Data // IssuerId is the issuer ID to be included in the certificate name. IssuerId enc.Component // NotBefore is the start of the certificate validity period. NotBefore time.Time // NotAfter is the end of the certificate validity period. NotAfter time.Time // Description is extra information to be included in the certificate. Description map[string]string }
SignCertArgs are the arguments to SignCert.
type TrustConfig ¶ added in v1.4.3
type TrustConfig struct {
// contains filtered or unexported fields
}
TrustConfig is the configuration of the trust module.
func NewTrustConfig ¶ added in v1.4.3
func NewTrustConfig(keyChain ndn.KeyChain, schema ndn.TrustSchema, roots []enc.Name) (*TrustConfig, error)
NewTrustConfig creates a new TrustConfig. ALl roots must be full names and already present in the keychain.
func (*TrustConfig) String ¶ added in v1.4.3
func (tc *TrustConfig) String() string
func (*TrustConfig) Suggest ¶ added in v1.4.3
func (tc *TrustConfig) Suggest(name enc.Name) ndn.Signer
Suggest suggests a signer for a given name.
func (*TrustConfig) Validate ¶ added in v1.4.3
func (tc *TrustConfig) Validate(args TrustConfigValidateArgs)
Validate validates a Data packet using a fetch API.
type TrustConfigValidateArgs ¶ added in v1.4.3
type TrustConfigValidateArgs struct { // Data is the packet to validate. Data ndn.Data // DataSigCov is the signature covered data wire. DataSigCov enc.Wire // Fetch is the fetch function to use for fetching certificates. Fetch func(enc.Name, *ndn.InterestConfig, ndn.ExpressCallbackFunc) // Callback is the callback to call when validation is done. Callback func(bool, error) // OverrideName is an override for the data name (advanced usage). OverrideName enc.Name // contains filtered or unexported fields }
TrustConfigValidateArgs are the arguments for the TrustConfig Validate function.