Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ResolveSigningVM ¶
func ResolveSigningVM(kid string, didResolver didResolver) (*did.VerificationMethod, string, error)
ResolveSigningVM resolves a DID KeyID using the given did resolver, and returns either:
- the Verification Method identified by the given key ID, or
- the first Assertion Method in the DID doc, if the DID provided has no fragment component.
Returns:
- a verification method suitable for signing.
- the full DID#KID identifier of the returned verification method.
func SignJWT ¶
func SignJWT( headers, claims map[string]interface{}, kid string, signerProvider SignerGetter, didResolver didResolver, ) (string, error)
SignJWT signs a JWT using a key in the given KMS, identified by an owned DID.
Args: - Headers to include in the created JWT. - Claims for the created JWT. - The ID of the key to use for signing, as a DID, either with a fragment identifier to specify a verification method, or without, in which case the first Authentication or Assertion verification method is used. - A SignerGetter that can provide a signer when given the key ID for the signing key. - A VDR that can resolve the provided DID.
Types ¶
type SignerGetter ¶
type SignerGetter func(vm *did.VerificationMethod) (Signer, error)
SignerGetter creates a signer that signs with the private key corresponding to the given public key.
func UseDefaultSigner ¶
func UseDefaultSigner(r keyReader, s cryptoSigner) SignerGetter
UseDefaultSigner provides SignJWT with a signer that uses the given KMS and Crypto instances.
Click to show internal directories.
Click to hide internal directories.