Varnish module (VMOD) for creating SHA256 digests and hmacs with the VCL data type BLOB.
Find a file
2022-12-08 14:01:08 +01:00
m4 initial commit 2016-04-15 14:49:31 +02:00
src Fix make distcheck. 2020-08-11 18:33:57 +02:00
.dir-locals.el initial commit 2016-04-15 14:49:31 +02:00
.gitignore initial commit 2016-04-15 14:49:31 +02:00
autogen.sh initial commit 2016-04-15 14:49:31 +02:00
configure.ac Update for compatibility with Varnish 5.1. 2017-05-11 12:25:42 +02:00
LICENSE Standardize LICENSE 2022-12-01 16:19:16 +01:00
Makefile.am Fix previous: if COPYING is removed, it should be from the Makefile 2022-12-08 14:01:08 +01:00
README.rst Update reformatted README. 2020-08-11 18:33:39 +02:00

..
.. NB:  This file is machine generated, DO NOT EDIT!
..
.. Edit ../src/vmod_blobsha256.vcc and run make instead
..

.. role:: ref(emphasis)

===============
vmod_blobsha256
===============

----------------------------------------------
SHA256 digests and hmacs for the VCL blob type
----------------------------------------------

:Manual section: 3

SYNOPSIS
========

.. parsed-literal::

  import blobsha256 [as name] [from "path"]
  
  new xhmac = blobsha256.hmac(BLOB key)
  
      BLOB xhmac.hmac(BLOB msg)
   
  new xblob = blobsha256.blob(BLOB blob)
  
      BLOB xblob.hash()
   
  BLOB hashf(BLOB msg)
  
  BLOB hmacf(BLOB msg, BLOB key)
  
  STRING version()
  


.. _blobsha256.hmac():

new xhmac = blobsha256.hmac(BLOB key)
-------------------------------------

Description
	Creates an object that generates HMACs based on SHA256 and the
	given ``key``.

Example
	new key = blobcode.blob(BASE64, "a2V5");
	new hmac = blobsha256.hmac(key.get());

.. _xhmac.hmac():

BLOB xhmac.hmac(BLOB msg)
-------------------------

Description
	Returns the HMAC-SHA256 message authentication code for
	``msg`` based on the key provided in the constructor.

Example
	set req.http.hmac = hmac.hmac(blobcode.decode(BASE64, "Zm9v"));

.. _blobsha256.blob():

new xblob = blobsha256.blob(BLOB blob)
--------------------------------------

Description
	Creates an object that returns the SHA256 digest of the given
	``blob``.

Example
	new key = blobcode.blob(BASE64, "Zm9v");
	new foo = blobsha256.blob(key.get());

.. _xblob.hash():

BLOB xblob.hash()
-----------------

Description
	Returns the SHA256 digest for the blob given in the constructor.

Example
	set req.http.X-Hash = blobcode.encode(BASE64, foo.hash());

.. _blobsha256.hashf():

BLOB hashf(BLOB msg)
--------------------

Description
	Returns the SHA256 digest for ``msg``.

.. _blobsha256.hmacf():

BLOB hmacf(BLOB msg, BLOB key)
------------------------------

Description
	Returns the SHA256 HMAC for ``msg`` based on ``key``.

.. _blobsha256.version():

STRING version()
----------------

Description
	Returns the version string for this VMOD.

Example
	std.log("Using VMOD blobsha256 version " + blobsha256.version());

REQUIREMENTS
------------

This version of the VMOD requires at least Varnish 5.1. See the
project repository for versions that are compatible with other Varnish
versions.

COPYRIGHT
=========

::

  Copyright (c) 2016 UPLEX Nils Goroll Systemoptimierung
  All rights reserved
 
  Author: Geoffrey Simmons <geoffrey.simmons@uplex.de>
 
  See LICENSE