%3 ::ns_hmac ::ns_hmac → file → string add destroy get init ::ns_crypto::HashFunctions ::ns_crypto::HashFunctions readfile ::ns_hmac->::ns_crypto::HashFunctions ::ns_md ::ns_md → file → string add destroy get init ::ns_md->::ns_crypto::HashFunctions ::nx::Object ::nx::Object ::ns_crypto::HashFunctions->::nx::Object

Class ::ns_hmac

::ns_hmac[i] create ... \
           [ -ctx ctx ] \
           [ -digest (default "sha256") ] \
           [ -key:required key:required ]

Defined in

Class Relations

  • class: ::nx::Class[i]
  • superclass: ::ns_crypto::HashFunctions[i]
::nx::Class create ::ns_hmac \
     -superclass ::ns_crypto::HashFunctions

Methods (to be applied on the object)

  • file (scripted, public)

     ns_hmac[i] file [ -digest digest ] [ -encoding encoding ] key filename \
        args [ args... ]
    Switches:
    -digest (optional, defaults to "sha256")
    -encoding (optional, defaults to "hex")
    Parameters:
    key (required)
    filename (required)
    args (required)

    Testcases:
    No testcase defined.
    set m [:new -digest $digest -key $key]
    set r ""
    foreach path [concat [list $filename$args] {
        if {![file readable $path]} {
            $m destroy
            return -code error "file $path is not readable"
        }
        set r [$m readfile -encoding $encoding $path]
    }
    $m destroy
    return $r
  • string (scripted, public)

     ns_hmac[i] string [ -digest digest ] [ -encoding encoding ] key message
    Switches:
    -digest (optional, defaults to "sha256")
    -encoding (optional, defaults to "hex")
    Parameters:
    key (required)
    message (required)

    Testcases:
    No testcase defined.
    ::ns_crypto::hmac string -digest $digest -encoding $encoding $key $message

Methods (to be applied on instances)

  • add (scripted, public)

     <instance of ns_hmac[i]> add message
    Parameters:
    message (required)

    Testcases:
    No testcase defined.
    ::ns_crypto::hmac add ${:ctx} $message
  • destroy (scripted, public)

     <instance of ns_hmac[i]> destroy

    Testcases:
    No testcase defined.
    ::ns_crypto::hmac free ${:ctx}
    next
  • get (scripted, public)

     <instance of ns_hmac[i]> get [ -encoding encoding ]
    Switches:
    -encoding (optional, defaults to "hex")

    Testcases:
    No testcase defined.
    ::ns_crypto::hmac get -encoding $encoding ${:ctx}