jwejson

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AESGCMKeyEncPayload

type AESGCMKeyEncPayload struct {
	// IV (Initialization Vector) Header Parameter.
	//
	// https://datatracker.ietf.org/doc/html/rfc7518#section-4.7.1.1
	//
	// The "iv" (initialization vector) Header Parameter value is the
	// base64url-encoded representation of the 96-bit IV value used for the
	// key encryption operation. This Header Parameter MUST be present and
	// MUST be understood and processed by implementations when these
	// algorithms are used.
	IV string `json:"iv"`
	// Tag (Authentication Tag) Header Parameter.
	//
	// https://datatracker.ietf.org/doc/html/rfc7518#section-4.7.1.2
	//
	// The "tag" (authentication tag) Header Parameter value is the
	// base64url-encoded representation of the 128-bit Authentication Tag
	// value resulting from the key encryption operation. This Header
	// Parameter MUST be present and MUST be understood and processed by
	// implementations when these algorithms are used.
	Tag string `json:"tag"`
}

AESGCMKeyEncPayload represents the AES GCM key encryption algorithm header parameters.

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

type ECDHKeyAgrPayload

type ECDHKeyAgrPayload struct {
	// EPK (Ephemeral Public Key) Header Parameter.
	//
	// https://datatracker.ietf.org/doc/html/rfc7518#section-4.6.1.1
	//
	// The "epk" (ephemeral public key) value created by the originator for
	// the use in key agreement algorithms. This key is represented as a
	// JSON Web Key [JWK] public key value. It MUST contain only public key
	// parameters and SHOULD contain only the minimum JWK parameters
	// necessary to represent the key; other JWK parameters included can be
	// checked for consistency and honored, or they can be ignored. This
	// Header Parameter MUST be present and MUST be understood and processed
	// by implementations when these algorithms are used.
	EPK *jwkjson.ECDHPayload `json:"epk"`
	// APU (Agreement PartyUInfo) Header Parameter.
	//
	// https://datatracker.ietf.org/doc/html/rfc7518#section-4.6.1.2
	//
	// The "apu" (agreement PartyUInfo) value for key agreement algorithms
	// using it (such as "ECDH-ES"), represented as a base64url-encoded
	// string. When used, the PartyUInfo value contains information about
	// the producer. Use of this Header Parameter is OPTIONAL. This Header
	// Parameter MUST be understood and processed by implementations when
	// these algorithms are used.
	APU string `json:"apu,omitempty"`
	// APV (Agreement PartyVInfo) Header Parameter.
	//
	// https://datatracker.ietf.org/doc/html/rfc7518#section-4.6.1.3
	//
	// The "apv" (agreement PartyVInfo) value for key agreement algorithms
	// using it (such as "ECDH-ES"), represented as a base64url encoded
	// string. When used, the PartyVInfo value contains information about
	// the recipient. Use of this Header Parameter is OPTIONAL. This
	// Header Parameter MUST be understood and processed by implementations
	// when these algorithms are used.
	APV string `json:"apv,omitempty"`
}

ECDHKeyAgrPayload represents the ECDH-ES key agreement algorithm header parameters.

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

type PBES2KeyEncPayload

type PBES2KeyEncPayload struct {
	// P2S (PBES2 Salt Input) Header Parameter.
	//
	// https://datatracker.ietf.org/doc/html/rfc7518#section-4.8.1.1
	//
	// The "p2s" (PBES2 salt input) Header Parameter encodes a Salt Input
	// value, which is used as part of the PBKDF2 salt value. The "p2s"
	// value is BASE64URL(Salt Input). This Header Parameter MUST be
	// present and MUST be understood and processed by implementations when
	// these algorithms are used.
	//
	// The salt expands the possible keys that can be derived from a given
	// password. A Salt Input value containing 8 or more octets MUST be
	// used. A new Salt Input value MUST be generated randomly for every
	// encryption operation; see RFC 4086 [RFC4086] for considerations on
	// generating random values. The salt value used is (UTF8(Alg) || 0x00
	// || Salt Input), where Alg is the "alg" (algorithm) Header Parameter
	// value.
	P2S string `json:"p2s"`
	// P2C (PBES2 Count) Header Parameter.
	//
	// https://datatracker.ietf.org/doc/html/rfc7518#section-4.8.1.2
	//
	// The "p2c" (PBES2 count) Header Parameter contains the PBKDF2
	// iteration count, represented as a positive JSON integer. This Header
	// Parameter MUST be present and MUST be understood and processed by
	// implementations when these algorithms are used.
	//
	// The iteration count adds computational expense, ideally compounded by
	// the possible range of keys introduced by the salt. A minimum
	// iteration count of 1000 is RECOMMENDED.
	P2C int `json:"p2c"`
}

PBES2KeyEncPayload represents the PBES2 key encryption algorithm header parameters.

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

Jump to

Keyboard shortcuts

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