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 { // UUID assigned by the oac-service. For example, 48958871-6a6d-4a25-889f-88c9c6835780. The `credential.id` // value will be a URL that can be dereferenced, which includes this ID. ID string `json:"id,omitempty"` // Fully qualified verification method ID that can be used to verify the credential. For example // `did:ion:EiDpQBo_nEfuLVeppgmPVQNEhtrnZLWFsB9ziZUuaKCJ3Q#83526c36-136c-423b-a57a-f190b83ae531`. FullyQualifiedVerificationMethodID string `json:"fullyQualifiedVerificationMethodId,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. Verification can be done according to // `fullyQualifiedVerificationMethodId`. 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