Versions in this module Expand all Collapse all v4 v4.0.4 May 30, 2024 Changes in this version + const A128CBC_HS256 + const A128GCM + const A128GCMKW + const A128KW + const A192CBC_HS384 + const A192GCM + const A192GCMKW + const A192KW + const A256CBC_HS512 + const A256GCM + const A256GCMKW + const A256KW + const DEFLATE + const DIRECT + const ECDH_ES + const ECDH_ES_A128KW + const ECDH_ES_A192KW + const ECDH_ES_A256KW + const ED25519 + const ES256 + const ES384 + const ES512 + const EdDSA + const HS256 + const HS384 + const HS512 + const HeaderContentType + const HeaderType + const NONE + const PBES2_HS256_A128KW + const PBES2_HS384_A192KW + const PBES2_HS512_A256KW + const PS256 + const PS384 + const PS512 + const RS256 + const RS384 + const RS512 + const RSA1_5 + const RSA_OAEP + const RSA_OAEP_256 + var ErrCryptoFailure = errors.New("go-jose/go-jose: error in cryptographic primitive") + var ErrInvalidKeySize = errors.New("go-jose/go-jose: invalid key size for algorithm") + var ErrMissingX5cHeader = errors.New("go-jose/go-jose: no x5c header present in message") + var ErrNotSupported = errors.New("go-jose/go-jose: compact serialization not supported for object") + var ErrUnprotectedNonce = errors.New("go-jose/go-jose: Nonce parameter included in unprotected header") + var ErrUnsupportedAlgorithm = errors.New("go-jose/go-jose: unknown/unsupported algorithm") + var ErrUnsupportedEllipticCurve = errors.New("go-jose/go-jose: unsupported/unknown elliptic curve") + var ErrUnsupportedKeyType = errors.New("go-jose/go-jose: unsupported key type/format") + var RandReader = rand.Reader + type CompressionAlgorithm string + type ContentEncryption string + type ContentType string + type Encrypter interface + Encrypt func(plaintext []byte) (*JSONWebEncryption, error) + EncryptWithAuthData func(plaintext []byte, aad []byte) (*JSONWebEncryption, error) + Options func() EncrypterOptions + func NewEncrypter(enc ContentEncryption, rcpt Recipient, opts *EncrypterOptions) (Encrypter, error) + func NewMultiEncrypter(enc ContentEncryption, rcpts []Recipient, opts *EncrypterOptions) (Encrypter, error) + type EncrypterOptions struct + Compression CompressionAlgorithm + ExtraHeaders map[HeaderKey]interface{} + func (eo *EncrypterOptions) WithContentType(contentType ContentType) *EncrypterOptions + func (eo *EncrypterOptions) WithHeader(k HeaderKey, v interface{}) *EncrypterOptions + func (eo *EncrypterOptions) WithType(typ ContentType) *EncrypterOptions + type Header struct + Algorithm string + ExtraHeaders map[HeaderKey]interface{} + JSONWebKey *JSONWebKey + KeyID string + Nonce string + func (h Header) Certificates(opts x509.VerifyOptions) ([][]*x509.Certificate, error) + type HeaderKey string + type JSONWebEncryption struct + Header Header + func ParseEncrypted(input string, keyEncryptionAlgorithms []KeyAlgorithm, ...) (*JSONWebEncryption, error) + func ParseEncryptedCompact(input string, keyAlgorithms []KeyAlgorithm, ...) (*JSONWebEncryption, error) + func ParseEncryptedJSON(input string, keyEncryptionAlgorithms []KeyAlgorithm, ...) (*JSONWebEncryption, error) + func (obj JSONWebEncryption) CompactSerialize() (string, error) + func (obj JSONWebEncryption) Decrypt(decryptionKey interface{}) ([]byte, error) + func (obj JSONWebEncryption) DecryptMulti(decryptionKey interface{}) (int, Header, []byte, error) + func (obj JSONWebEncryption) FullSerialize() string + func (obj JSONWebEncryption) GetAuthData() []byte + type JSONWebKey struct + Algorithm string + CertificateThumbprintSHA1 []byte + CertificateThumbprintSHA256 []byte + Certificates []*x509.Certificate + CertificatesURL *url.URL + Key interface{} + KeyID string + Use string + func (k *JSONWebKey) IsPublic() bool + func (k *JSONWebKey) Public() JSONWebKey + func (k *JSONWebKey) Thumbprint(hash crypto.Hash) ([]byte, error) + func (k *JSONWebKey) UnmarshalJSON(data []byte) (err error) + func (k *JSONWebKey) Valid() bool + func (k JSONWebKey) MarshalJSON() ([]byte, error) + type JSONWebKeySet struct + Keys []JSONWebKey + func (s *JSONWebKeySet) Key(kid string) []JSONWebKey + type JSONWebSignature struct + Signatures []Signature + func ParseDetached(signature string, payload []byte, signatureAlgorithms []SignatureAlgorithm) (*JSONWebSignature, error) + func ParseSigned(signature string, signatureAlgorithms []SignatureAlgorithm) (*JSONWebSignature, error) + func ParseSignedCompact(signature string, signatureAlgorithms []SignatureAlgorithm) (*JSONWebSignature, error) + func ParseSignedJSON(input string, signatureAlgorithms []SignatureAlgorithm) (*JSONWebSignature, error) + func (obj JSONWebSignature) CompactSerialize() (string, error) + func (obj JSONWebSignature) DetachedCompactSerialize() (string, error) + func (obj JSONWebSignature) DetachedVerify(payload []byte, verificationKey interface{}) error + func (obj JSONWebSignature) DetachedVerifyMulti(payload []byte, verificationKey interface{}) (int, Signature, error) + func (obj JSONWebSignature) FullSerialize() string + func (obj JSONWebSignature) UnsafePayloadWithoutVerification() []byte + func (obj JSONWebSignature) Verify(verificationKey interface{}) ([]byte, error) + func (obj JSONWebSignature) VerifyMulti(verificationKey interface{}) (int, Signature, []byte, error) + type KeyAlgorithm string + type NonceSource interface + Nonce func() (string, error) + type OpaqueKeyDecrypter interface + DecryptKey func(encryptedKey []byte, header Header) ([]byte, error) + type OpaqueKeyEncrypter interface + Algs func() []KeyAlgorithm + KeyID func() string + type OpaqueSigner interface + Algs func() []SignatureAlgorithm + Public func() *JSONWebKey + SignPayload func(payload []byte, alg SignatureAlgorithm) ([]byte, error) + type OpaqueVerifier interface + VerifyPayload func(payload []byte, signature []byte, alg SignatureAlgorithm) error + type Recipient struct + Algorithm KeyAlgorithm + Key interface{} + KeyID string + PBES2Count int + PBES2Salt []byte + type Signature struct + Header Header + Protected Header + Signature []byte + Unprotected Header + type SignatureAlgorithm string + type Signer interface + Options func() SignerOptions + Sign func(payload []byte) (*JSONWebSignature, error) + func NewMultiSigner(sigs []SigningKey, opts *SignerOptions) (Signer, error) + func NewSigner(sig SigningKey, opts *SignerOptions) (Signer, error) + type SignerOptions struct + EmbedJWK bool + ExtraHeaders map[HeaderKey]interface{} + NonceSource NonceSource + func (so *SignerOptions) WithBase64(b64 bool) *SignerOptions + func (so *SignerOptions) WithContentType(contentType ContentType) *SignerOptions + func (so *SignerOptions) WithCritical(names ...string) *SignerOptions + func (so *SignerOptions) WithHeader(k HeaderKey, v interface{}) *SignerOptions + func (so *SignerOptions) WithType(typ ContentType) *SignerOptions + type SigningKey struct + Algorithm SignatureAlgorithm + Key interface{} Other modules containing this package github.com/simontol/go-jose