hmac

package
v0.1.0-alpha.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2024 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Package hmac implements HMAC operations as described in the specifications at §29 (https://www.w3.org/TR/WebCryptoAPI/#hmac).

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CryptoKey

type CryptoKey struct {
	// contains filtered or unexported fields
}

func (*CryptoKey) Algorithm

func (c *CryptoKey) Algorithm() webcrypto.KeyAlgorithm

func (*CryptoKey) Extractable

func (c *CryptoKey) Extractable() bool

func (*CryptoKey) Name

func (a *CryptoKey) Name() string

func (*CryptoKey) Type

func (c *CryptoKey) Type() webcrypto.KeyType

func (*CryptoKey) Usages

func (c *CryptoKey) Usages() []webcrypto.KeyUsage

type ImportParams

type ImportParams struct {
	// The inner hash function to use.
	Hash string
	// The length (in bits) of the key.
	Length uint64
}

ImportParams represents the dictionary specification of §29.3 (https://www.w3.org/TR/WebCryptoAPI/#dfn-HmacImportParams)

type KeyAlgorithm

type KeyAlgorithm struct {
	// contains filtered or unexported fields
}

KeyAlgorithm represents the dictionary specification of §29.4 (https://www.w3.org/TR/WebCryptoAPI/#HmacKeyAlgorithm-dictionary)

func (*KeyAlgorithm) Hash

func (k *KeyAlgorithm) Hash() string

Hash is the inner hash function to use.

func (*KeyAlgorithm) Length

func (k *KeyAlgorithm) Length() uint64

Length is the length (in bits) of the key.

func (*KeyAlgorithm) Name

func (k *KeyAlgorithm) Name() string

Name is the algorithm name.

type KeyGenParams

type KeyGenParams struct {
	// The inner hash function to use.
	Hash string
	// The length (in bits) of the key to generate. If unspecified, the
	// recommended length will be used, which is the size of the associated hash function's block
	// size.
	Length uint64
}

KeyGenParams represents the dictionary specification of §29.5 (https://www.w3.org/TR/WebCryptoAPI/#dfn-HmacKeyGenParams)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL