ndn-embeds 0.1.0
Lightweight NDN protocol stack for embedded systems
Loading...
Searching...
No Matches
signature.hpp File Reference

NDN signature types and constants. More...

#include <cstddef>
#include <cstdint>

Go to the source code of this file.

Enumerations

enum class  ndn::SignatureType : uint8_t {
  DigestSha256 = 0 , SignatureSha256WithRsa = 1 , SignatureSha256WithEcdsa = 3 , SignatureHmacWithSha256 = 4 ,
  SignatureEd25519 = 5
}
 Signature type. More...
 

Functions

constexpr const char * ndn::signatureTypeToString (SignatureType type)
 Convert signature type to string.
 

Variables

Signature size constants
constexpr size_t ndn::SHA256_DIGEST_SIZE = 32
 SHA-256 digest size (bytes)
 
constexpr size_t ndn::HMAC_SHA256_SIZE = 32
 HMAC-SHA256 size (bytes)
 
constexpr size_t ndn::ECDSA_P256_SIG_MAX_SIZE = 72
 ECDSA P-256 signature max size (DER format)
 
constexpr size_t ndn::ED25519_SIG_SIZE = 64
 Ed25519 signature size (bytes)
 
constexpr size_t ndn::RSA_2048_SIG_SIZE = 256
 RSA-2048 signature size (bytes)
 
constexpr size_t ndn::SIGNATURE_MAX_SIZE = 72
 Maximum signature size (for ECDSA P-256, embedded)
 
Public key size constants
constexpr size_t ndn::ECDSA_P256_PUBKEY_SIZE = 65
 ECDSA P-256 public key size (uncompressed form)
 
constexpr size_t ndn::ECDSA_P256_PRIVKEY_SIZE = 32
 ECDSA P-256 private key size.
 
constexpr size_t ndn::ED25519_PUBKEY_SIZE = 32
 Ed25519 public key size.
 
constexpr size_t ndn::ED25519_PRIVKEY_SIZE = 32
 Ed25519 private key size.
 

Detailed Description

NDN signature types and constants.

Defines types and constants related to NDN packet signatures.

See also
https://docs.named-data.net/NDN-packet-spec/current/signature.html

Definition in file signature.hpp.

Enumeration Type Documentation

◆ SignatureType

enum class ndn::SignatureType : uint8_t
strong

Signature type.

Represents signature algorithms defined in the NDN specification.

Enumerator
DigestSha256 

SHA-256 digest (integrity only)

SignatureSha256WithRsa 

RSA signature (PKCS#1 v1.5)

SignatureSha256WithEcdsa 

ECDSA signature.

SignatureHmacWithSha256 

HMAC-SHA256 (shared key)

SignatureEd25519 

Ed25519 signature.

Definition at line 22 of file signature.hpp.

Function Documentation

◆ signatureTypeToString()

constexpr const char * ndn::signatureTypeToString ( SignatureType  type)
constexpr

Convert signature type to string.

Parameters
typeSignature type
Returns
String representation of the signature type

Definition at line 55 of file signature.hpp.

References ndn::signatureTypeToString().

Referenced by ndn::signatureTypeToString().

Variable Documentation

◆ ECDSA_P256_PRIVKEY_SIZE

constexpr size_t ndn::ECDSA_P256_PRIVKEY_SIZE = 32
constexpr

ECDSA P-256 private key size.

Definition at line 45 of file signature.hpp.

Referenced by ndn::crypto::ecdsaP256GenerateKeyPair(), and ndn::crypto::ecdsaP256Sign().

◆ ECDSA_P256_PUBKEY_SIZE

constexpr size_t ndn::ECDSA_P256_PUBKEY_SIZE = 65
constexpr

ECDSA P-256 public key size (uncompressed form)

Definition at line 44 of file signature.hpp.

Referenced by ndn::crypto::ecdsaP256GenerateKeyPair(), and ndn::crypto::ecdsaP256Verify().

◆ ECDSA_P256_SIG_MAX_SIZE

constexpr size_t ndn::ECDSA_P256_SIG_MAX_SIZE = 72
constexpr

ECDSA P-256 signature max size (DER format)

Definition at line 35 of file signature.hpp.

Referenced by ndn::crypto::ecdsaP256Sign(), ndn::Data::verifyEcdsa(), and ndn::Interest::verifyEcdsa().

◆ ED25519_PRIVKEY_SIZE

constexpr size_t ndn::ED25519_PRIVKEY_SIZE = 32
constexpr

Ed25519 private key size.

Definition at line 47 of file signature.hpp.

◆ ED25519_PUBKEY_SIZE

constexpr size_t ndn::ED25519_PUBKEY_SIZE = 32
constexpr

Ed25519 public key size.

Definition at line 46 of file signature.hpp.

◆ ED25519_SIG_SIZE

constexpr size_t ndn::ED25519_SIG_SIZE = 64
constexpr

Ed25519 signature size (bytes)

Definition at line 36 of file signature.hpp.

◆ HMAC_SHA256_SIZE

constexpr size_t ndn::HMAC_SHA256_SIZE = 32
constexpr

◆ RSA_2048_SIG_SIZE

constexpr size_t ndn::RSA_2048_SIG_SIZE = 256
constexpr

RSA-2048 signature size (bytes)

Definition at line 37 of file signature.hpp.

◆ SHA256_DIGEST_SIZE

◆ SIGNATURE_MAX_SIZE

constexpr size_t ndn::SIGNATURE_MAX_SIZE = 72
constexpr

Maximum signature size (for ECDSA P-256, embedded)

Definition at line 38 of file signature.hpp.

Referenced by ndn::Certificate::fromData(), ndn::Data::fromWire(), and ndn::Interest::fromWire().