Documentation
¶
Index ¶
- type Claims
- type NewOpt
- func WithAudience(audience string) NewOpt
- func WithDecoyDigests(flag bool) NewOpt
- func WithExpiry(expiry *jwt.NumericDate) NewOpt
- func WithHashAlgorithm(alg crypto.Hash) NewOpt
- func WithHolderPublicKey(jwk *jwk.JWK) NewOpt
- func WithID(id string) NewOpt
- func WithIssuedAt(issuedAt *jwt.NumericDate) NewOpt
- func WithJSONMarshaller(jsonMarshal func(v interface{}) ([]byte, error)) NewOpt
- func WithJTI(jti string) NewOpt
- func WithNonSelectivelyDisclosableClaims(nonSDClaims []string) NewOpt
- func WithNotBefore(notBefore *jwt.NumericDate) NewOpt
- func WithSaltFnc(fnc func() (string, error)) NewOpt
- func WithStructuredClaims(flag bool) NewOpt
- func WithSubject(subject string) NewOpt
- type SelectiveDisclosureJWT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Claims ¶
Claims defines JSON Web Token Claims (https://tools.ietf.org/html/rfc7519#section-4)
type NewOpt ¶
type NewOpt func(opts *newOpts)
NewOpt is the SD-JWT New option.
func WithAudience ¶
WithAudience is an option for SD-JWT payload.
func WithDecoyDigests ¶
WithDecoyDigests is an option for adding decoy digests(default is false).
func WithExpiry ¶
func WithExpiry(expiry *jwt.NumericDate) NewOpt
WithExpiry is an option for SD-JWT payload.
func WithHashAlgorithm ¶
WithHashAlgorithm is an option for hashing disclosures.
func WithHolderPublicKey ¶
WithHolderPublicKey is an option for SD-JWT payload.
func WithIssuedAt ¶
func WithIssuedAt(issuedAt *jwt.NumericDate) NewOpt
WithIssuedAt is an option for SD-JWT payload.
func WithJSONMarshaller ¶
WithJSONMarshaller is option is for marshalling disclosure.
func WithNonSelectivelyDisclosableClaims ¶
WithNonSelectivelyDisclosableClaims is an option for provide claim names that should be ignored when creating selectively disclosable claims. For example if you would like to not selectively disclose id and degree type from the following claims: {
"degree": { "degree": "MIT", "type": "BachelorDegree", }, "name": "Jayden Doe", "id": "did:example:ebfeb1f712ebc6f1c276e12ec21", }
you should specify the following array: []string{"id", "degree.type"}.
func WithNotBefore ¶
func WithNotBefore(notBefore *jwt.NumericDate) NewOpt
WithNotBefore is an option for SD-JWT payload.
func WithSaltFnc ¶
WithSaltFnc is option is for marshalling disclosure.
func WithStructuredClaims ¶
WithStructuredClaims is an option for handling structured claims(default is false).
func WithSubject ¶
WithSubject is an option for SD-JWT payload.
type SelectiveDisclosureJWT ¶
type SelectiveDisclosureJWT struct { SignedJWT *afgjwt.JSONWebToken Disclosures []string }
SelectiveDisclosureJWT defines Selective Disclosure JSON Web Token (https://tools.ietf.org/html/rfc7519)
func New ¶
func New(issuer string, claims interface{}, headers jose.Headers, signer jose.Signer, opts ...NewOpt) (*SelectiveDisclosureJWT, error)
New creates new signed Selective Disclosure JWT based on input claims.
func NewFromVC ¶
func NewFromVC(vc map[string]interface{}, headers jose.Headers, signer jose.Signer, opts ...NewOpt) (*SelectiveDisclosureJWT, error)
NewFromVC creates new signed Selective Disclosure JWT based on vc.
func (*SelectiveDisclosureJWT) DecodeClaims ¶
func (j *SelectiveDisclosureJWT) DecodeClaims(c interface{}) error
DecodeClaims fills input c with claims of a token.
func (*SelectiveDisclosureJWT) LookupStringHeader ¶
func (j *SelectiveDisclosureJWT) LookupStringHeader(name string) string
LookupStringHeader makes look up of particular header with string value.