Documentation ¶
Overview ¶
Package signature is a generated GoMock package.
Index ¶
- Variables
- func AddContext(context interface{}, newContext ssi.URI) []interface{}
- func NewContextLoader(allowExternalCalls bool) (ld.DocumentLoader, error)
- func NewEmbeddedFSDocumentLoader(fs embed.FS, nextLoader ld.DocumentLoader) ld.DocumentLoader
- type JSONWebSignature2020
- type LDUtil
- type LegacyNutsSuite
- type MockSuite
- type MockSuiteMockRecorder
- type Suite
Constants ¶
This section is empty.
Variables ¶
var JSONWebSignature2020Context = ssi.MustParseURI("https://w3c-ccg.github.io/lds-jws2020/contexts/lds-jws2020-v1.json")
JSONWebSignature2020Context defines the JsonWebSignature2020 json-ld context
var W3idSecurityV1Context = ssi.MustParseURI("https://w3id.org/security/v1")
W3idSecurityV1Context defines the v1 of the w3id json-ld context
var W3idSecurityV2Context = ssi.MustParseURI("https://w3id.org/security/v2")
W3idSecurityV2Context defines the v2 of the w3id json-ld context
Functions ¶
func AddContext ¶
AddContext adds the context to the @context array. It makes sure no duplicates will exist.
func NewContextLoader ¶
func NewContextLoader(allowExternalCalls bool) (ld.DocumentLoader, error)
NewContextLoader creates a new JSON-LD context loader with the embedded FS as first loader. It loads the most used context from the embedded FS. This ensures the contents cannot be altered. If allowExternalCalls is set to true, it also loads external context from the internet.
func NewEmbeddedFSDocumentLoader ¶
func NewEmbeddedFSDocumentLoader(fs embed.FS, nextLoader ld.DocumentLoader) ld.DocumentLoader
NewEmbeddedFSDocumentLoader creates a new embeddedFSDocumentLoader for an embedded filesystem.
Types ¶
type JSONWebSignature2020 ¶
type JSONWebSignature2020 struct {
ContextLoader ld.DocumentLoader
}
JSONWebSignature2020 Contains the correct implementation of the JSONWebSignature2020 signature suite It bundles the correct implementation of the canonicalize, hash and sign operations.
func (JSONWebSignature2020) CalculateDigest ¶
func (s JSONWebSignature2020) CalculateDigest(doc []byte) []byte
CalculateDigest calculates the digest of the document. This implementation uses the SHA256 sum.
func (JSONWebSignature2020) CanonicalizeDocument ¶
func (s JSONWebSignature2020) CanonicalizeDocument(doc interface{}) ([]byte, error)
CanonicalizeDocument canonicalizes a document using the LD canonicalization algorithm. Can be used for both the LD proof as the document. It requires the document to have a valid context.
func (JSONWebSignature2020) GetType ¶
func (s JSONWebSignature2020) GetType() ssi.ProofType
GetType returns the signature type, 'JSONWebSignature2020'
type LDUtil ¶
type LDUtil struct {
LDDocumentLoader ld.DocumentLoader
}
LDUtil package a set of often used JSON-LD operations for re-usability.
func (LDUtil) Canonicalize ¶
Canonicalize canonicalizes the json-ld input according to the URDNA2015 [RDF-DATASET-NORMALIZATION] algorithm.
type LegacyNutsSuite ¶
type LegacyNutsSuite struct { }
LegacyNutsSuite is the first and wrong implementation of a JSONWebSignature. It is here so all the signatures set in the develop network are still valid. Must be removed in Node version 2.
func (LegacyNutsSuite) CalculateDigest ¶
func (l LegacyNutsSuite) CalculateDigest(doc []byte) []byte
CalculateDigest returns a digest for the doc by calculating the SHA256 hash.
func (LegacyNutsSuite) CanonicalizeDocument ¶
func (l LegacyNutsSuite) CanonicalizeDocument(doc interface{}) ([]byte, error)
CanonicalizeDocument canonicalizes the document by marshalling it to json
func (LegacyNutsSuite) GetType ¶
func (l LegacyNutsSuite) GetType() ssi.ProofType
GetType returns the signature type
type MockSuite ¶
type MockSuite struct {
// contains filtered or unexported fields
}
MockSuite is a mock of Suite interface.
func NewMockSuite ¶
func NewMockSuite(ctrl *gomock.Controller) *MockSuite
NewMockSuite creates a new mock instance.
func (*MockSuite) CalculateDigest ¶
CalculateDigest mocks base method.
func (*MockSuite) CanonicalizeDocument ¶
CanonicalizeDocument mocks base method.
func (*MockSuite) EXPECT ¶
func (m *MockSuite) EXPECT() *MockSuiteMockRecorder
EXPECT returns an object that allows the caller to indicate expected use.
type MockSuiteMockRecorder ¶
type MockSuiteMockRecorder struct {
// contains filtered or unexported fields
}
MockSuiteMockRecorder is the mock recorder for MockSuite.
func (*MockSuiteMockRecorder) CalculateDigest ¶
func (mr *MockSuiteMockRecorder) CalculateDigest(doc interface{}) *gomock.Call
CalculateDigest indicates an expected call of CalculateDigest.
func (*MockSuiteMockRecorder) CanonicalizeDocument ¶
func (mr *MockSuiteMockRecorder) CanonicalizeDocument(doc interface{}) *gomock.Call
CanonicalizeDocument indicates an expected call of CanonicalizeDocument.
func (*MockSuiteMockRecorder) GetType ¶
func (mr *MockSuiteMockRecorder) GetType() *gomock.Call
GetType indicates an expected call of GetType.
func (*MockSuiteMockRecorder) Sign ¶
func (mr *MockSuiteMockRecorder) Sign(doc, key interface{}) *gomock.Call
Sign indicates an expected call of Sign.