Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodeSignature ¶
DecodeSignature decodes the base64url encoded JWS signature into a byte array
Types ¶
type DecodeOption ¶
type DecodeOption func(opts *decodeOptions)
DecodeOption represents an option that can be passed to Decode or Verify.
type Decoded ¶
type Decoded struct { Header Header Payload []byte Signature []byte Parts []string SignerDID _did.DID }
Decoded is a compact JWS decoded into its parts
func Decode ¶
func Decode(jws string, opts ...DecodeOption) (Decoded, error)
Decode decodes the given JWS string into a Decoded type
Note ¶
The given JWS input is assumed to be a compact JWS
type Header ¶
type Header struct { // Ide ntifies the cryptographic algorithm used to secure the JWS. The JWS Signature value is not // valid if the "alg" value does not represent a supported algorithm or if there is not a key for // use with that algorithm associated with the party that digitally signed or MACed the content. // // "alg" values should either be registered in the IANA "JSON Web Signature and Encryption // Algorithms" registry or be a value that contains a Collision-Resistant Name. The "alg" value is // a case-sensitive ASCII string. This Header Parameter MUST be present and MUST be understood // and processed by implementations. // // [Specification]: https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.1 ALG string `json:"alg,omitempty"` // Key ID Header Parameter https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.4 KID string `json:"kid,omitempty"` // Type Header Parameter https://datatracker.ietf.org/doc/html/rfc7515#section-4.1.9 TYP string `json:"typ,omitempty"` }
Header represents a JWS (JSON Web Signature) header. See [Specification] for more details. [Specification]: https://datatracker.ietf.org/doc/html/rfc7515#section-4
func DecodeHeader ¶
DecodeHeader decodes the base64url encoded JWS header into a Header
type SignOpt ¶
type SignOpt func(opts *signOpts)
func DetachedPayload ¶
func VMSelector ¶
func VMSelector(selector didcore.VMSelector) SignOpt
func VerificationMethod ¶
Click to show internal directories.
Click to hide internal directories.