jws
packageThis package is not in the latest version of its module.
Details
Validgo.mod file
The Go module system was introduced in Go 1.11 and is the official dependency management solution for Go.
Redistributable license
Redistributable licenses place minimal restrictions on how software can be used, modified, and redistributed.
Tagged version
Modules with tagged versions give importers more predictable builds.
Stable version
When a project reaches major version v1 it is considered stable.
- Learn more about best practices
Repository
Links
Documentation¶
Overview¶
Package jws provides a partial implementationof JSON Web Signature encoding and decoding.It exists to support thegolang.org/x/oauth2 package.
SeeRFC 7515.
Deprecated: this package is not intended for public use and might beremoved in the future. It exists for internal use only.Please switch to another JWS package or copy this package into your ownsource tree.
Index¶
Constants¶
This section is empty.
Variables¶
This section is empty.
Functions¶
funcEncode¶
Encode encodes a signed JWS with provided header and claim set.This invokesEncodeWithSigner usingcrypto/rsa.SignPKCS1v15 with the given RSA private key.
funcEncodeWithSigner¶
EncodeWithSigner encodes a header and claim set with the provided signer.
Types¶
typeClaimSet¶
type ClaimSet struct {Issstring `json:"iss"`// email address of the client_id of the application making the access token requestScopestring `json:"scope,omitempty"`// space-delimited list of the permissions the application requestsAudstring `json:"aud"`// descriptor of the intended target of the assertion (Optional).Expint64 `json:"exp"`// the expiration time of the assertion (seconds since Unix epoch)Iatint64 `json:"iat"`// the time the assertion was issued (seconds since Unix epoch)Typstring `json:"typ,omitempty"`// token type (Optional).// Email for which the application is requesting delegated access (Optional).Substring `json:"sub,omitempty"`// The old name of Sub. Client keeps setting Prn to be// complaint with legacy OAuth 2.0 providers. (Optional)Prnstring `json:"prn,omitempty"`// Seehttp://tools.ietf.org/html/draft-jones-json-web-token-10#section-4.3// This array is marshalled using custom code (see (c *ClaimSet) encode()).PrivateClaims map[string]any `json:"-"`}ClaimSet contains information about the JWT signature including thepermissions being requested (scopes), the target of the token, the issuer,the time the token was issued, and the lifetime of the token.