jwa

package
v0.0.0-...-ccd4941 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2023 License: MPL-2.0 Imports: 0 Imported by: 0

Documentation

Overview

Package jwa implements JWA (JSON Web Algorithms) as defined in RFC 7518.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Algorithm

type Algorithm = string

Algorithm represents a cryptographic algorithm used for signing or encrypting a JWS or JWE object respectively.

https://datatracker.ietf.org/doc/html/rfc7518#section-3.1

const (
	HS256 Algorithm = "HS256"
	HS384 Algorithm = "HS384"
	HS512 Algorithm = "HS512"
)

HMAC with SHA-2 Functions

These algorithms are used to construct a MAC using a shared secret and the Hash-based Message Authentication Code (HMAC) construction [RFC2104] employing SHA-2 [SHS] hash functions.

https://datatracker.ietf.org/doc/html/rfc7518#section-3.2

const (
	RS256 Algorithm = "RS256"
	RS384 Algorithm = "RS384"
	RS512 Algorithm = "RS512"
)

RSASSA-PKCS1-v1_5

These algorithms are used to digitally sign a JWS and produce a JWS Signature using PKCS #1 v1.5 methods.

RSA Key Size

A key of size 2048 bits or larger MUST be used with these algorithms.

https://datatracker.ietf.org/doc/html/rfc7518#section-3.3

const (
	ES256 Algorithm = "ES256"
	ES384 Algorithm = "ES384"
	ES512 Algorithm = "ES512"
)

ECDSA

These algorithms are used to digitally sign a JWS and produce a JWS Signature using ECDSA algorithms.

https://datatracker.ietf.org/doc/html/rfc7518#section-3.4

const (
	PS256 Algorithm = "PS256"
	PS384 Algorithm = "PS384"
	PS512 Algorithm = "PS512"
)

RSASSA-PSS

These algorithms are used to digitally sign a JWS and produce a JWS Signature using the RSASSA-PSS algorithms.

RSA Key Size

A key of size 2048 bits or larger MUST be used with these algorithms.

https://datatracker.ietf.org/doc/html/rfc7518#section-3.5

const ES256K Algorithm = "ES256K"
ECDSA with secp256k1 and SHA-256 (used in Bitcoin and Ethereum).

Warning

This algorithm is not implemented in this library, but is included for completeness and documentation purposes.

https://datatracker.ietf.org/doc/html/draft-jones-webauthn-secp256k1 https://datatracker.ietf.org/doc/html/draft-ietf-cose-webauthn-algorithms-04#section-3.2

const EdDSA Algorithm = "EdDSA"

EdDSA algorithms using Ed25519 (and Ed448, which is not implemented).

https://datatracker.ietf.org/doc/html/rfc8037#section-3.1

const None Algorithm = "none"

No signature or MAC performed (unprotected JWS). This algorithm is intended to be used to create a JWS that is not integrity protected.

Warning

The use of this algorithm is considered dangerous. Do NOT use this algorithm, it's only implemented for completeness.

https://datatracker.ietf.org/doc/html/rfc7518#section-3.6

Jump to

Keyboard shortcuts

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