Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainersToInterface ¶
func CopyCredential ¶
func CopyCredential(c credential.VerifiableCredential) (*credential.VerifiableCredential, error)
CopyCredential copies a credential into a new credential
Types ¶
type Container ¶
type Container struct { // Credential ID. This is the same value as the id within the secured credential. It is typically a URL that can be // dereferenced. For example, `https://ssi-service.com/v1/credentials/48958871-6a6d-4a25-889f-88c9c6835780`. ID string `json:"id,omitempty"` // The KID of the private key used to sign `credentialJwt`. IssuerKID string `json:"issuerKid,omitempty"` // Verifiable Credential in the `application/vc+ld+json` format. The credential is secured with an external proof // using JWS. In other words, the `proof` field is not present. See `credentialJwt` for the secured Verifiable // Credential. Credential *credential.VerifiableCredential `json:"credential,omitempty"` // JWT representation of `credential`, secured with an external proof signed by `issuerKid`. CredentialJWT *keyaccess.JWT `json:"credentialJwt,omitempty"` // Whether this credential is currently revoked. Revoked bool `json:"revoked,omitempty"` // Whether this credential is currently suspended. Suspended bool `json:"suspended,omitempty"` }
Container acts as an abstraction over both possible credential representations JWT representations are parsed upon container creation, while the original JWT is maintained
func NewCredentialContainerFromArray ¶
NewCredentialContainerFromArray attempts to parse arrays of credentials of any type (either data integrity or JWT) into an array of CredentialContainers. The method will return an error if any of the credentials are invalid.
func NewCredentialContainerFromJWT ¶
NewCredentialContainerFromJWT attempts to parse a VC-JWT credential from a string into a Container
func NewCredentialContainerFromMap ¶
NewCredentialContainerFromMap attempts to parse a data integrity credential from a piece of JSON, which is represented as a map in go, into a Container
func (Container) HasDataIntegrityCredential ¶
func (Container) HasJWTCredential ¶
func (Container) HasSignedCredential ¶
type Verifier ¶
type Verifier struct {
// contains filtered or unexported fields
}
func NewCredentialVerifier ¶
func NewCredentialVerifier(didResolver resolution.Resolver, schemaResolver schema.Resolution) (*Verifier, error)
NewCredentialVerifier creates a new credential verifier which executes both signature and static verification checks. In the future the set of verification checks will be configurable.
func (Verifier) VerifyDataIntegrityCredential ¶
func (v Verifier) VerifyDataIntegrityCredential(ctx context.Context, credential credsdk.VerifiableCredential) error
VerifyDataIntegrityCredential first checks the signature on the given data integrity credential. Next, it runs a set of static verification checks on the credential as per the credential service's configuration.
func (Verifier) VerifyJWTCredential ¶
VerifyJWTCredential first parses and checks the signature on the given JWT credential. Next, it runs a set of static verification checks on the credential as per the credential service's configuration.