Involved Source Files
Package jws provides a partial implementation
of JSON Web Signature encoding and decoding.
It exists to support the golang.org/x/oauth2 package.
See RFC 7515.
Deprecated: this package is not intended for public use and might be
removed in the future. It exists for internal use only.
Please switch to another JWS package or copy this package into your own
source tree.
Package-Level Type Names (total 3, all are exported)
/* sort exporteds by: | */
ClaimSet contains information about the JWT signature including the
permissions being requested (scopes), the target of the token, the issuer,
the time the token was issued, and the lifetime of the token.
// descriptor of the intended target of the assertion (Optional).
// the expiration time of the assertion (seconds since Unix epoch)
// the time the assertion was issued (seconds since Unix epoch)
// email address of the client_id of the application making the access token request
See http://tools.ietf.org/html/draft-jones-json-web-token-10#section-4.3
This array is marshalled using custom code (see (c *ClaimSet) encode()).
The old name of Sub. Client keeps setting Prn to be
complaint with legacy OAuth 2.0 providers. (Optional)
// space-delimited list of the permissions the application requests
Email for which the application is requesting delegated access (Optional).
// token type (Optional).
(*T) encode() (string, error)
func Decode(payload string) (*ClaimSet, error)
func Encode(header *Header, c *ClaimSet, key *rsa.PrivateKey) (string, error)
func EncodeWithSigner(header *Header, c *ClaimSet, sg Signer) (string, error)
Package-Level Functions (total 4, all are exported)
Decode decodes a claim set from a JWS payload.
Encode encodes a signed JWS with provided header and claim set.
This invokes EncodeWithSigner using crypto/rsa.SignPKCS1v15 with the given RSA private key.
EncodeWithSigner encodes a header and claim set with the provided signer.
Verify tests whether the provided JWT token's signature was produced by the private key
associated with the supplied public key.
The pages are generated with Goldsv0.3.2-preview. (GOOS=darwin GOARCH=amd64)
Golds is a Go 101 project developed by Tapir Liu.
PR and bug reports are welcome and can be submitted to the issue list.
Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds.