@blockchaincommons/components - v1.0.0-beta.4
    Preparing search index...

    Function hashTypeFromCbor

    Encrypted key module - Password-based and key-based key derivation

    This module provides types and operations for encrypting symmetric keys using various key derivation functions (KDFs).

    Supported key derivation methods:

    • HKDF: For deriving keys from high-entropy inputs (not passwords)
    • PBKDF2: Password-based, widely compatible
    • Scrypt: Memory-hard, resistant to GPU attacks
    • Argon2id: Most secure for passwords (default)
    • SSHAgent: An SSH agent's signature over the salt (needs an SshAgent)

    The main components are:

    • EncryptedKey: Encrypted symmetric key with derivation parameters
    • KeyDerivationMethod: Enum of supported methods
    • KeyDerivationParams: Union type for method-specific parameters
    • Individual parameter types: HKDFParams, PBKDF2Params, ScryptParams, Argon2idParams, SSHAgentParams
    • As the reference's TryFrom<CBOR> (error type Error): a u8 with dcbor's negative wrap (-256 reads as 0, SHA-256), then General Invalid HashType for any other value; a non-integer or out-of-width head is Cbor (CBOR error: …).

      Parameters

      • cborValue: Cbor

      Returns HashType