...

Package jwa

import "github.com/lestrrat-go/jwx/jwa"
Overview
Index

Overview ▾

Package jwa defines the various algorithm described in https://tools.ietf.org/html/rfc7518

type CompressionAlgorithm

CompressionAlgorithm represents the compression algorithms as described in https://tools.ietf.org/html/rfc7518#section-7.3

type CompressionAlgorithm string

Supported values for CompressionAlgorithm

const (
    Deflate    CompressionAlgorithm = "DEF" // DEFLATE (RFC 1951)
    NoCompress CompressionAlgorithm = ""    // No compression
)

func CompressionAlgorithms

func CompressionAlgorithms() []CompressionAlgorithm

CompressionAlgorithms returns a list of all available values for CompressionAlgorithm

func (*CompressionAlgorithm) Accept

func (v *CompressionAlgorithm) Accept(value interface{}) error

Accept is used when conversion from values given by outside sources (such as JSON payloads) is required

func (CompressionAlgorithm) String

func (v CompressionAlgorithm) String() string

String returns the string representation of a CompressionAlgorithm

type ContentEncryptionAlgorithm

ContentEncryptionAlgorithm represents the various encryption algorithms as described in https://tools.ietf.org/html/rfc7518#section-5

type ContentEncryptionAlgorithm string

Supported values for ContentEncryptionAlgorithm

const (
    A128CBC_HS256 ContentEncryptionAlgorithm = "A128CBC-HS256" // AES-CBC + HMAC-SHA256 (128)
    A128GCM       ContentEncryptionAlgorithm = "A128GCM"       // AES-GCM (128)
    A192CBC_HS384 ContentEncryptionAlgorithm = "A192CBC-HS384" // AES-CBC + HMAC-SHA384 (192)
    A192GCM       ContentEncryptionAlgorithm = "A192GCM"       // AES-GCM (192)
    A256CBC_HS512 ContentEncryptionAlgorithm = "A256CBC-HS512" // AES-CBC + HMAC-SHA512 (256)
    A256GCM       ContentEncryptionAlgorithm = "A256GCM"       // AES-GCM (256)
)

func ContentEncryptionAlgorithms

func ContentEncryptionAlgorithms() []ContentEncryptionAlgorithm

ContentEncryptionAlgorithms returns a list of all available values for ContentEncryptionAlgorithm

func (*ContentEncryptionAlgorithm) Accept

func (v *ContentEncryptionAlgorithm) Accept(value interface{}) error

Accept is used when conversion from values given by outside sources (such as JSON payloads) is required

func (ContentEncryptionAlgorithm) String

func (v ContentEncryptionAlgorithm) String() string

String returns the string representation of a ContentEncryptionAlgorithm

type EllipticCurveAlgorithm

EllipticCurveAlgorithm represents the algorithms used for EC keys

type EllipticCurveAlgorithm string

Supported values for EllipticCurveAlgorithm

const (
    Ed25519              EllipticCurveAlgorithm = "Ed25519"
    Ed448                EllipticCurveAlgorithm = "Ed448"
    InvalidEllipticCurve EllipticCurveAlgorithm = "P-invalid"
    P256                 EllipticCurveAlgorithm = "P-256"
    P384                 EllipticCurveAlgorithm = "P-384"
    P521                 EllipticCurveAlgorithm = "P-521"
    X25519               EllipticCurveAlgorithm = "X25519"
    X448                 EllipticCurveAlgorithm = "X448"
)

func EllipticCurveAlgorithms

func EllipticCurveAlgorithms() []EllipticCurveAlgorithm

EllipticCurveAlgorithms returns a list of all available values for EllipticCurveAlgorithm

func (*EllipticCurveAlgorithm) Accept

func (v *EllipticCurveAlgorithm) Accept(value interface{}) error

Accept is used when conversion from values given by outside sources (such as JSON payloads) is required

func (EllipticCurveAlgorithm) String

func (v EllipticCurveAlgorithm) String() string

String returns the string representation of a EllipticCurveAlgorithm

type KeyEncryptionAlgorithm

KeyEncryptionAlgorithm represents the various encryption algorithms as described in https://tools.ietf.org/html/rfc7518#section-4.1

type KeyEncryptionAlgorithm string

Supported values for KeyEncryptionAlgorithm

const (
    A128GCMKW          KeyEncryptionAlgorithm = "A128GCMKW"          // AES-GCM key wrap (128)
    A128KW             KeyEncryptionAlgorithm = "A128KW"             // AES key wrap (128)
    A192GCMKW          KeyEncryptionAlgorithm = "A192GCMKW"          // AES-GCM key wrap (192)
    A192KW             KeyEncryptionAlgorithm = "A192KW"             // AES key wrap (192)
    A256GCMKW          KeyEncryptionAlgorithm = "A256GCMKW"          // AES-GCM key wrap (256)
    A256KW             KeyEncryptionAlgorithm = "A256KW"             // AES key wrap (256)
    DIRECT             KeyEncryptionAlgorithm = "dir"                // Direct encryption
    ECDH_ES            KeyEncryptionAlgorithm = "ECDH-ES"            // ECDH-ES
    ECDH_ES_A128KW     KeyEncryptionAlgorithm = "ECDH-ES+A128KW"     // ECDH-ES + AES key wrap (128)
    ECDH_ES_A192KW     KeyEncryptionAlgorithm = "ECDH-ES+A192KW"     // ECDH-ES + AES key wrap (192)
    ECDH_ES_A256KW     KeyEncryptionAlgorithm = "ECDH-ES+A256KW"     // ECDH-ES + AES key wrap (256)
    PBES2_HS256_A128KW KeyEncryptionAlgorithm = "PBES2-HS256+A128KW" // PBES2 + HMAC-SHA256 + AES key wrap (128)
    PBES2_HS384_A192KW KeyEncryptionAlgorithm = "PBES2-HS384+A192KW" // PBES2 + HMAC-SHA384 + AES key wrap (192)
    PBES2_HS512_A256KW KeyEncryptionAlgorithm = "PBES2-HS512+A256KW" // PBES2 + HMAC-SHA512 + AES key wrap (256)
    RSA1_5             KeyEncryptionAlgorithm = "RSA1_5"             // RSA-PKCS1v1.5
    RSA_OAEP           KeyEncryptionAlgorithm = "RSA-OAEP"           // RSA-OAEP-SHA1
    RSA_OAEP_256       KeyEncryptionAlgorithm = "RSA-OAEP-256"       // RSA-OAEP-SHA256
)

func KeyEncryptionAlgorithms

func KeyEncryptionAlgorithms() []KeyEncryptionAlgorithm

KeyEncryptionAlgorithms returns a list of all available values for KeyEncryptionAlgorithm

func (*KeyEncryptionAlgorithm) Accept

func (v *KeyEncryptionAlgorithm) Accept(value interface{}) error

Accept is used when conversion from values given by outside sources (such as JSON payloads) is required

func (KeyEncryptionAlgorithm) IsSymmetric

func (v KeyEncryptionAlgorithm) IsSymmetric() bool

IsSymmetric returns true if the algorithm is a symmetric type

func (KeyEncryptionAlgorithm) String

func (v KeyEncryptionAlgorithm) String() string

String returns the string representation of a KeyEncryptionAlgorithm

type KeyType

KeyType represents the key type ("kty") that are supported

type KeyType string

Supported values for KeyType

const (
    EC             KeyType = "EC"  // Elliptic Curve
    InvalidKeyType KeyType = ""    // Invalid KeyType
    OKP            KeyType = "OKP" // Octet string key pairs
    OctetSeq       KeyType = "oct" // Octet sequence (used to represent symmetric keys)
    RSA            KeyType = "RSA" // RSA
)

func KeyTypes

func KeyTypes() []KeyType

KeyTypes returns a list of all available values for KeyType

func (*KeyType) Accept

func (v *KeyType) Accept(value interface{}) error

Accept is used when conversion from values given by outside sources (such as JSON payloads) is required

func (KeyType) String

func (v KeyType) String() string

String returns the string representation of a KeyType

type SignatureAlgorithm

SignatureAlgorithm represents the various signature algorithms as described in https://tools.ietf.org/html/rfc7518#section-3.1

type SignatureAlgorithm string

Supported values for SignatureAlgorithm

const (
    ES256       SignatureAlgorithm = "ES256"  // ECDSA using P-256 and SHA-256
    ES256K      SignatureAlgorithm = "ES256K" // ECDSA using secp256k1 and SHA-256
    ES384       SignatureAlgorithm = "ES384"  // ECDSA using P-384 and SHA-384
    ES512       SignatureAlgorithm = "ES512"  // ECDSA using P-521 and SHA-512
    EdDSA       SignatureAlgorithm = "EdDSA"  // EdDSA signature algorithms
    HS256       SignatureAlgorithm = "HS256"  // HMAC using SHA-256
    HS384       SignatureAlgorithm = "HS384"  // HMAC using SHA-384
    HS512       SignatureAlgorithm = "HS512"  // HMAC using SHA-512
    NoSignature SignatureAlgorithm = "none"
    PS256       SignatureAlgorithm = "PS256" // RSASSA-PSS using SHA256 and MGF1-SHA256
    PS384       SignatureAlgorithm = "PS384" // RSASSA-PSS using SHA384 and MGF1-SHA384
    PS512       SignatureAlgorithm = "PS512" // RSASSA-PSS using SHA512 and MGF1-SHA512
    RS256       SignatureAlgorithm = "RS256" // RSASSA-PKCS-v1.5 using SHA-256
    RS384       SignatureAlgorithm = "RS384" // RSASSA-PKCS-v1.5 using SHA-384
    RS512       SignatureAlgorithm = "RS512" // RSASSA-PKCS-v1.5 using SHA-512
)

func SignatureAlgorithms

func SignatureAlgorithms() []SignatureAlgorithm

SignatureAlgorithms returns a list of all available values for SignatureAlgorithm

func (*SignatureAlgorithm) Accept

func (v *SignatureAlgorithm) Accept(value interface{}) error

Accept is used when conversion from values given by outside sources (such as JSON payloads) is required

func (SignatureAlgorithm) String

func (v SignatureAlgorithm) String() string

String returns the string representation of a SignatureAlgorithm