security

package
v0.0.8 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckHmacSig added in v0.0.2

func CheckHmacSig(sigCovered enc.Wire, sigValue []byte, key []byte) bool

func EcdsaValidate added in v0.0.4

func EcdsaValidate(sigCovered enc.Wire, sig ndn.Signature, pubKey *ecdsa.PublicKey) bool

EcdsaValidate verifies the signature with a known ECC public key. ndn-cxx's PIB uses secp256r1 key stored in ASN.1 DER format. Use x509.ParsePKIXPublicKey to parse.

func EddsaValidate added in v0.0.4

func EddsaValidate(sigCovered enc.Wire, sig ndn.Signature, pubKey ed25519.PublicKey) bool

EddsaValidate verifies the signature with a known ed25519 public key. ndn-cxx's PIB does not support this, but a certificate is supposed to use ASN.1 DER format. Use x509.ParsePKIXPublicKey to parse. Note: ed25519.PublicKey is defined to be a pointer type without '*'.

func HmacValidate added in v0.0.4

func HmacValidate(sigCovered enc.Wire, sig ndn.Signature, key []byte) bool

HmacValidate verifies the signature with a known HMAC shared key.

func NewEccSigner added in v0.0.4

func NewEccSigner(
	forCert bool, forInt bool, expireTime time.Duration, key *ecdsa.PrivateKey,
	keyLocatorName enc.Name,
) ndn.Signer

NewEccSigner creates a signer using ECDSA key

func NewEmptySigner

func NewEmptySigner() ndn.Signer

NewEmptySigner creates an empty signer for test.

func NewHmacIntSigner added in v0.0.2

func NewHmacIntSigner(key []byte, timer ndn.Timer) ndn.Signer

NewHmacIntSigner creates an Interest signer that uses DigestSha256.

func NewHmacSigner added in v0.0.2

func NewHmacSigner(keyName enc.Name, key []byte, forCert bool, expireTime time.Duration) ndn.Signer

NewHmacSigner creates a Data signer that uses DigestSha256.

func NewRsaSigner added in v0.0.4

func NewRsaSigner(
	forCert bool, forInt bool, expireTime time.Duration, key *rsa.PrivateKey,
	keyLocatorName enc.Name,
) ndn.Signer

NewRsaSigner creates a signer using RSA key

func NewSha256IntSigner

func NewSha256IntSigner(timer ndn.Timer) ndn.Signer

NewSha256IntSigner creates an Interest signer that uses DigestSha256.

func NewSha256Signer

func NewSha256Signer() ndn.Signer

NewSha256Signer creates a Data signer that uses DigestSha256.

func RsaValidate added in v0.0.4

func RsaValidate(sigCovered enc.Wire, sig ndn.Signature, pubKey *rsa.PublicKey) bool

RsaValidate verifies the signature with a known RSA public key. ndn-cxx's PIB uses RSA 2048 key stored in ASN.1 DER format. Use x509.ParsePKIXPublicKey to parse.

func Sha256Validate added in v0.0.4

func Sha256Validate(sigCovered enc.Wire, sig ndn.Signature) bool

HmacValidate verifies the sha256 digest.

Types

This section is empty.

Directories

Path Synopsis
Generated by the generator, DO NOT modify manually
Generated by the generator, DO NOT modify manually

Jump to

Keyboard shortcuts

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