verification

package
v0.1.5 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 12, 2022 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const DidMethod string = "hid"
View Source
const EcdsaSecp256k1VerificationKey2019 = "EcdsaSecp256k1VerificationKey2019"
View Source
const Ed25519VerificationKey2020 = "Ed25519VerificationKey2020"

Supported Verification Method Types

Variables

View Source
var AcceptedCredStatuses = []string{
	"Live",
	"Suspended",
	"Revoked",
	"Expired",
}

Acceptable Credential Status. Ref: https://github.com/hypersign-protocol/hid-node/discussions/141#discussioncomment-2825349

View Source
var ServiceTypes = []string{
	"LinkedDomains",
}
View Source
var VerificationKeySignatureMap = map[string]string{
	"Ed25519VerificationKey2020":        "Ed25519Signature2020",
	"EcdsaSecp256k1VerificationKey2019": "EcdsaSecp256k1Signature2019",
}

Mapping between Verification Key and its corresponding Signature

Functions

func DocumentProofTypeCheck

func DocumentProofTypeCheck(inputProofType string, signers []types.Signer, vmId string) error

func DuplicateServiceExists

func DuplicateServiceExists(serviceId string, services []*types.Service) bool

func HasAtleastOneTrueSigner

func HasAtleastOneTrueSigner(s []types.ValidDid) types.ValidDid

func IsValidDidFragment

func IsValidDidFragment(didUrl string, method string, namespace string) bool

Check for valid DID fragment

func IsValidDidServiceType

func IsValidDidServiceType(sType string) bool

Check Valid DID service type

func IsValidID

func IsValidID(Id string, namespace string, docType string) error

Checks whether the ID in the DidDoc is a valid string

func ValidateDidDocument

func ValidateDidDocument(didDoc *types.Did, genesisNamespace string) error

Checks whether the DidDoc string is valid

func ValidateServices

func ValidateServices(services []*types.Service, method string, namespace string) error

Cheks whether the Service is valid

func VerifyCredentialHash

func VerifyCredentialHash(credHash string) bool

func VerifyCredentialProofDates

func VerifyCredentialProofDates(credProof *types.CredentialProof, credRegistration bool) error

func VerifyCredentialStatusDates

func VerifyCredentialStatusDates(issuanceDate time.Time, expirationDate time.Time) error

func VerifyDidDeactivate

func VerifyDidDeactivate(metadata *types.Metadata, id string) error

Check the Deactivate status of DID

func VerifyDidSignature

func VerifyDidSignature(ctx *sdk.Context, didDocBytes []byte, signers []types.Signer, signatures []*types.SignInfo) error

func VerifyDocumentSignature

func VerifyDocumentSignature(ctx *sdk.Context, docBytes []byte, signers []types.Signer, signatures []*types.SignInfo) error

Verify Signature for Credential Schema and Credential Status Documents

func VerifyIdentitySignature

func VerifyIdentitySignature(signer types.Signer, signatures []*types.SignInfo, signingInput []byte) (bool, error)

Verify signatures against signer's public keys If atleast one of the signatures is valid, return true

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL