WARNING: The online documentation has moved to https://docs.pjsip.org.

Visit the new documentation at https://docs.pjsip.org:

BLOG | DOCUMENTATION | GITHUB

Home --> Documentations --> PJLIB-UTIL Reference

HMAC SHA1 Message Authentication

Data Structures

struct  pj_hmac_sha1_context
 

Functions

void pj_hmac_sha1 (const pj_uint8_t *input, unsigned input_len, const pj_uint8_t *key, unsigned key_len, pj_uint8_t digest[20])
 
void pj_hmac_sha1_init (pj_hmac_sha1_context *hctx, const pj_uint8_t *key, unsigned key_len)
 
void pj_hmac_sha1_update (pj_hmac_sha1_context *hctx, const pj_uint8_t *input, unsigned input_len)
 
void pj_hmac_sha1_final (pj_hmac_sha1_context *hctx, pj_uint8_t digest[20])
 

Detailed Description

This module contains the implementation of HMAC: Keyed-Hashing for Message Authentication, as described in RFC 2104.

Function Documentation

◆ pj_hmac_sha1()

void pj_hmac_sha1 ( const pj_uint8_t input,
unsigned  input_len,
const pj_uint8_t key,
unsigned  key_len,
pj_uint8_t  digest[20] 
)

Calculate HMAC-SHA1 digest for the specified input and key with this single function call.

Parameters
inputPointer to the input stream.
input_lenLength of input stream in bytes.
keyPointer to the authentication key.
key_lenLength of the authentication key.
digestBuffer to be filled with HMAC SHA1 digest.

◆ pj_hmac_sha1_final()

void pj_hmac_sha1_final ( pj_hmac_sha1_context hctx,
pj_uint8_t  digest[20] 
)

Finish the message and return the digest.

Parameters
hctxHMAC-SHA1 context.
digestBuffer to be filled with HMAC SHA1 digest.

References PJ_END_DECL.

◆ pj_hmac_sha1_init()

void pj_hmac_sha1_init ( pj_hmac_sha1_context hctx,
const pj_uint8_t key,
unsigned  key_len 
)

Initiate HMAC-SHA1 context for incremental hashing.

Parameters
hctxHMAC-SHA1 context.
keyPointer to the authentication key.
key_lenLength of the authentication key.

◆ pj_hmac_sha1_update()

void pj_hmac_sha1_update ( pj_hmac_sha1_context hctx,
const pj_uint8_t input,
unsigned  input_len 
)

Append string to the message.

Parameters
hctxHMAC-SHA1 context.
inputPointer to the input stream.
input_lenLength of input stream in bytes.

 


PJLIB-UTIL Open Source, small footprint, and portable asynchronous/caching DNS resolver, text scanner, STUN client, and XML library
Copyright (C) 2006-2009 Teluu Inc.