macula_registry_verify (macula v0.20.5)
View SourceMacula Registry Signature Verification
Provides Ed25519 digital signature operations for package verification: - Keypair generation - Package signing - Signature verification - Public key validation
All functions are stateless and can be called directly.
Summary
Functions
Compute SHA-256 checksum of data
Decode hex-encoded public key back to binary
Encode public key as hex string for display/storage
Generate a new Ed25519 keypair Returns {PublicKey, PrivateKey} as raw binaries
Sign arbitrary data with Ed25519 private key
Sign package data (manifest + archive) The signature covers the SHA-256 hash of (manifest_binary ++ beam_archive)
Validate that a binary is a valid Ed25519 private key
Validate that a binary is a valid Ed25519 public key
Verify package signature Reconstructs the signed data from manifest and archive, then verifies
Verify a signature against data and public key
Functions
Compute SHA-256 checksum of data
Decode hex-encoded public key back to binary
Encode public key as hex string for display/storage
Generate a new Ed25519 keypair Returns {PublicKey, PrivateKey} as raw binaries
Sign arbitrary data with Ed25519 private key
-spec sign_package(ManifestBin :: binary(), BeamArchive :: binary(), PrivateKey :: binary()) -> {ok, Signature :: binary()} | {error, term()}.
Sign package data (manifest + archive) The signature covers the SHA-256 hash of (manifest_binary ++ beam_archive)
-spec validate_private_key(PrivateKey :: binary()) -> ok | {error, invalid_key}.
Validate that a binary is a valid Ed25519 private key
-spec validate_public_key(PublicKey :: binary()) -> ok | {error, invalid_key}.
Validate that a binary is a valid Ed25519 public key
-spec verify_package(ManifestBin :: binary(), BeamArchive :: binary(), Signature :: binary(), PublicKey :: binary()) -> ok | {error, term()}.
Verify package signature Reconstructs the signed data from manifest and archive, then verifies
-spec verify_signature(Data :: binary(), Signature :: binary(), PublicKey :: binary()) -> ok | {error, invalid_signature}.
Verify a signature against data and public key