Documentation ¶
Index ¶
- func GetJWTHeaders(token []byte) (jws.Headers, error)
- type DataIntegrityJSON
- type DataIntegrityKeyAccess
- func (ka DataIntegrityKeyAccess) Sign(payload cryptosuite.WithEmbeddedProof) (*DataIntegrityJSON, error)
- func (ka DataIntegrityKeyAccess) SignVerifiablePresentation(_ string, _ credential.VerifiablePresentation) (*DataIntegrityJSON, error)
- func (ka DataIntegrityKeyAccess) Verify(payload cryptosuite.WithEmbeddedProof) error
- func (ka DataIntegrityKeyAccess) VerifyVerifiablePresentation(_ cryptosuite.WithEmbeddedProof) error
- type JWKKeyAccess
- func (ka JWKKeyAccess) Sign(payload map[string]any) (*JWT, error)
- func (ka JWKKeyAccess) SignJSON(data any) (*JWT, error)
- func (ka JWKKeyAccess) SignVerifiableCredential(cred credential.VerifiableCredential) (*JWT, error)
- func (ka JWKKeyAccess) SignVerifiablePresentation(audience string, presentation credential.VerifiablePresentation) (*JWT, error)
- func (ka JWKKeyAccess) Verify(token JWT) error
- func (ka JWKKeyAccess) VerifyVerifiableCredential(token JWT) (*credential.VerifiableCredential, error)
- func (ka JWKKeyAccess) VerifyVerifiablePresentation(ctx context.Context, resolver resolution.Resolver, token JWT) (*credential.VerifiablePresentation, error)
- type JWT
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DataIntegrityJSON ¶
type DataIntegrityJSON struct {
Data []byte `json:"data" validate:"required"`
}
DataIntegrityJSON represents a response from a DataIntegrityKeyAccess.Sign() call represented as a serialized JSON object
type DataIntegrityKeyAccess ¶
type DataIntegrityKeyAccess struct { Signer jws2020.JSONWebKeySigner Verifier jws2020.JSONWebKeyVerifier CryptoSuite cryptosuite.CryptoSuite }
DataIntegrityKeyAccess represents a key access object for data integrity using the JsonWebSignature2020 suite: https://w3c.github.io/vc-jws-2020/
func NewDataIntegrityKeyAccess ¶
func NewDataIntegrityKeyAccess(id, kid string, key gocrypto.PrivateKey) (*DataIntegrityKeyAccess, error)
NewDataIntegrityKeyAccess creates a new DataIntegrityKeyAccess object from an id, key id, and private key, generating both JSON Web Key Signer and Verifier objects.
func (DataIntegrityKeyAccess) Sign ¶
func (ka DataIntegrityKeyAccess) Sign(payload cryptosuite.WithEmbeddedProof) (*DataIntegrityJSON, error)
func (DataIntegrityKeyAccess) SignVerifiablePresentation ¶
func (ka DataIntegrityKeyAccess) SignVerifiablePresentation(_ string, _ credential.VerifiablePresentation) (*DataIntegrityJSON, error)
func (DataIntegrityKeyAccess) Verify ¶
func (ka DataIntegrityKeyAccess) Verify(payload cryptosuite.WithEmbeddedProof) error
func (DataIntegrityKeyAccess) VerifyVerifiablePresentation ¶
func (ka DataIntegrityKeyAccess) VerifyVerifiablePresentation(_ cryptosuite.WithEmbeddedProof) error
type JWKKeyAccess ¶
func NewJWKKeyAccess ¶
func NewJWKKeyAccess(id, kid string, key gocrypto.PrivateKey) (*JWKKeyAccess, error)
NewJWKKeyAccess creates a JWKKeyAccess object from an id, key id, and private key, generating both JWT Signer and Verifier objects.
func NewJWKKeyAccessVerifier ¶
func NewJWKKeyAccessVerifier(id, kid string, key gocrypto.PublicKey) (*JWKKeyAccess, error)
NewJWKKeyAccessVerifier creates JWKKeyAccess object from an id, key id, and public key, generating a JWT Verifier object.
func (JWKKeyAccess) SignJSON ¶
func (ka JWKKeyAccess) SignJSON(data any) (*JWT, error)
SignJSON takes an object that is either itself json or json-serializable and signs it.
func (JWKKeyAccess) SignVerifiableCredential ¶
func (ka JWKKeyAccess) SignVerifiableCredential(cred credential.VerifiableCredential) (*JWT, error)
func (JWKKeyAccess) SignVerifiablePresentation ¶
func (ka JWKKeyAccess) SignVerifiablePresentation(audience string, presentation credential.VerifiablePresentation) (*JWT, error)
func (JWKKeyAccess) Verify ¶
func (ka JWKKeyAccess) Verify(token JWT) error
func (JWKKeyAccess) VerifyVerifiableCredential ¶
func (ka JWKKeyAccess) VerifyVerifiableCredential(token JWT) (*credential.VerifiableCredential, error)
func (JWKKeyAccess) VerifyVerifiablePresentation ¶
func (ka JWKKeyAccess) VerifyVerifiablePresentation(ctx context.Context, resolver resolution.Resolver, token JWT) (*credential.VerifiablePresentation, error)