jose

package
v0.0.0-...-3814c95 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2015 License: MPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RSAPKCS1WithSHA256 = JoseAlgorithm("RS256")
	RSAPKCS1WithSHA384 = JoseAlgorithm("RS384")
	RSAPKCS1WithSHA512 = JoseAlgorithm("RS512")
	ECDSAWithSHA256    = JoseAlgorithm("ES256")
	ECDSAWithSHA384    = JoseAlgorithm("ES384")
	ECDSAWithSHA512    = JoseAlgorithm("ES512")
	RSAPSSWithSHA256   = JoseAlgorithm("PS256")
	RSAPSSWithSHA384   = JoseAlgorithm("PS384")
	RSAPSSWithSHA512   = JoseAlgorithm("PS512")
)
View Source
const (
	CurveP256 = JoseCurve("P-256")
	CurveP384 = JoseCurve("P-384")
	CurveP512 = JoseCurve("P-512")
)
View Source
const (
	KeyTypeSymmetric = JoseKeyType("oct")
	KeyTypeRSA       = JoseKeyType("RSA")
	KeyTypeEC        = JoseKeyType("EC")
)

Variables

This section is empty.

Functions

func B64dec

func B64dec(x string) ([]byte, error)

func B64enc

func B64enc(x []byte) string

Types

type JoseAlgorithm

type JoseAlgorithm string

type JoseCurve

type JoseCurve string

type JoseKeyType

type JoseKeyType string

type JsonBuffer

type JsonBuffer json.RawMessage

Buffers that know how to do b64 and bigint

func (JsonBuffer) MarshalJSON

func (jb JsonBuffer) MarshalJSON() ([]byte, error)

func (JsonBuffer) ToBigInt

func (jb JsonBuffer) ToBigInt() *big.Int

func (JsonBuffer) ToInt

func (jb JsonBuffer) ToInt() int

func (*JsonBuffer) UnmarshalJSON

func (jb *JsonBuffer) UnmarshalJSON(data []byte) error

type JsonWebKey

type JsonWebKey struct {
	KeyType    JoseKeyType
	Rsa        *rsa.PublicKey
	Ec         *ecdsa.PublicKey
	Thumbprint string
}

func (*JsonWebKey) ComputeThumbprint

func (jwk *JsonWebKey) ComputeThumbprint()

func (JsonWebKey) Equals

func (jwk1 JsonWebKey) Equals(jwk2 JsonWebKey) bool

Normal Go == operator compares pointers directly, so it doesn't match the semantic of two keys being equivalent

func (JsonWebKey) MarshalJSON

func (jwk JsonWebKey) MarshalJSON() ([]byte, error)

func (*JsonWebKey) UnmarshalJSON

func (jwk *JsonWebKey) UnmarshalJSON(data []byte) error

type JsonWebSignature

type JsonWebSignature rawJsonWebSignature

func Sign

func Sign(alg JoseAlgorithm, privateKey interface{}, payload []byte) (JsonWebSignature, error)

func UnmarshalCompact

func UnmarshalCompact(data []byte) (JsonWebSignature, error)

func (JsonWebSignature) MarshalCompact

func (jws JsonWebSignature) MarshalCompact() ([]byte, error)

func (*JsonWebSignature) UnmarshalJSON

func (jws *JsonWebSignature) UnmarshalJSON(data []byte) error

On unmarshal, copy protected header fields to protected

func (*JsonWebSignature) Verify

func (jws *JsonWebSignature) Verify() error

type JwsHeader

type JwsHeader struct {
	Algorithm JoseAlgorithm `json:"alg,omitempty"`
	Nonce     string        `json:"nonce,omitempty"`
	Key       JsonWebKey    `json:"jwk,omitempty"`
}

Jump to

Keyboard shortcuts

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