opa: github.com/open-policy-agent/opa/topdown/internal/jwx/jws/verify Index | Files

package verify

import "github.com/open-policy-agent/opa/topdown/internal/jwx/jws/verify"

Index

Package Files

ecdsa.go hmac.go interface.go rsa.go verify.go

type ECDSAVerifier Uses

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

ECDSAVerifier implements the Verifier interface

func (ECDSAVerifier) Verify Uses

func (v ECDSAVerifier) Verify(payload []byte, signature []byte, key interface{}) error

Verify checks whether the signature for a given input and key is correct

type HMACVerifier Uses

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

HMACVerifier implements the Verifier interface

func (HMACVerifier) Verify Uses

func (v HMACVerifier) Verify(signingInput, signature []byte, key interface{}) (err error)

Verify checks whether the signature for a given input and key is correct

type RSAVerifier Uses

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

RSAVerifier implements the Verifier interface

func (RSAVerifier) Verify Uses

func (v RSAVerifier) Verify(payload, signature []byte, key interface{}) error

Verify checks if a JWS is valid.

type Verifier Uses

type Verifier interface {
    // Verify checks whether the payload and signature are valid for
    // the given key.
    // `key` is the key used for verifying the payload, and is usually
    // the public key associated with the signature method. For example,
    // for `jwa.RSXXX` and `jwa.PSXXX` types, you need to pass the
    // `*"crypto/rsa".PublicKey` type.
    // Check the documentation for each verifier for details
    Verify(payload []byte, signature []byte, key interface{}) error
}

Verifier provides a common interface for supported alg verification methods

func New Uses

func New(alg jwa.SignatureAlgorithm) (Verifier, error)

New creates a new JWS verifier using the specified algorithm and the public key

Package verify imports 8 packages (graph) and is imported by 1 packages. Updated 2019-10-10. Refresh now. Tools for package owners.