Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions ssikit/ssikit.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ type Policy struct {
// TrustedIssuerRegistry Policy Argument - has to be provided to waltId
type TirArgument struct {
RegistryAddress string `json:"registryAddress"`
IssuerType string `json:"issuerType"`
}

// request structure for validating VCs at waltId
Expand All @@ -44,8 +45,9 @@ type verificationRequest struct {

// result of the individual policy
type verificationResult struct {
Valid bool `json:"valid"`
PolicyResults map[string]bool `json:"policyResults"`
Result bool `json:"result"`
Valid bool `json:"valid"`
PolicyResults map[string]isSuccess `json:"policyResults"`
}

// response structure from the verification request
Expand All @@ -54,6 +56,10 @@ type verificationResponse struct {
Results []verificationResult `json:"results"`
}

type isSuccess struct {
IsSuccess bool `json:"isSuccess"`
}

type SSIKit interface {
VerifyVC(policies []Policy, verifiableCredential map[string]interface{}) (result bool, err error)
}
Expand Down
2 changes: 1 addition & 1 deletion verifier/verifier.go
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ func InitVerifier(verifierConfig *configModel.Verifier, ssiKitClient ssikit.SSIK
{Policy: "IssuedDateBeforePolicy"},
{Policy: "ValidFromBeforePolicy"},
{Policy: "ExpirationDateAfterPolicy"},
{Policy: "TrustedIssuerRegistryPolicy", Argument: &ssikit.TirArgument{RegistryAddress: verifierConfig.TirAddress}},
{Policy: "EbsiTrustedIssuerRegistryPolicy", Argument: &ssikit.TirArgument{RegistryAddress: verifierConfig.TirAddress, IssuerType: "Undefined"}},
}

key, err := initPrivateKey()
Expand Down