Documentation ¶
Index ¶
- Constants
- func VerifyAttachmentData(data Data, keyID string) error
- type Attachment
- type Data
- type Exchange
- func CreateExchangeComplete(input ExchangeCompleteInput) (*Exchange, error)
- func CreateExchangeInvitation(input ExchangeInvitationInput) (*Exchange, error)
- func CreateExchangeProblem(input ExchangeProblemInput) (*Exchange, error)
- func CreateExchangeRequest(input ExchangeRequestResponseInput) (*Exchange, error)
- func CreateExchangeResponse(input ExchangeRequestResponseInput) (*Exchange, error)
- type ExchangeCompleteInput
- type ExchangeInvitationInput
- type ExchangeProblemInput
- type ExchangeRequestResponseInput
- type JWS
- type Metadata
- type ProblemCode
- type Thread
Constants ¶
const ( ExchangeInvitation = "https://didcomm.org/didexchange/1.0/invitation" ExchangeRequest = "https://didcomm.org/didexchange/1.0/request" ExchangeResponse = "https://didcomm.org/didexchange/1.0/response" ExchangeComplete = "https://didcomm.org/didexchange/1.0/complete" ExchangeProblem = "https://didcomm.org/didexchange/1.0/problem_report" )
Variables ¶
This section is empty.
Functions ¶
func VerifyAttachmentData ¶
VerifyAttachmentData takes in a DIDComm `Data` object along with a keyID to validate the data It is assumed that the data is a DID Document, which contains the key referenced by the parameter
Types ¶
type Attachment ¶
type Attachment struct { ID string `json:"@id,omitempty"` MimeType string `json:"mime-type,omitempty"` Data Data `json:"data"` }
Attachment is a structure used to attach Base64 encoded data to DIDComm messages. By convention, attachments, embedded or appended to json requests, have the key names that ends with the attachment decorator ("~attach"). Attachments can be signed (with JWS) or unsigned. Follows the Aries RFC 0017: Attachments protocol.
type Data ¶
Data contains the base64 encoded data and an optional JWS.
func CreateAttachmentData ¶
CreateAttachmentData takes a DID Document, and key and key id referenced in that document The attachment is a b64 encoded version of the did document in a detached JWS
type Exchange ¶
type Exchange struct { ID string `json:"@id"` Type []string `json:"@type"` Thread Thread `json:"~thread,omitempty"` Label string `json:"label,omitempty"` ServiceEndpoint did.URI `json:"serviceEndpoint,omitempty"` KID string `json:"kid,omitempty"` DID did.DID `json:"did,omitempty"` Attachment Attachment `json:"did_doc~attach,omitempty"` LogoURL did.URI `json:"logoUrl,omitempty"` ConnectionName string `json:"connectionName,omitempty"` ContactURL did.URI `json:"contactUrl,omitempty"` ProblemCode ProblemCode `json:"problemCode,omitempty"` Explain string `json:"explain,omitempty"` }
func CreateExchangeComplete ¶
func CreateExchangeComplete(input ExchangeCompleteInput) (*Exchange, error)
func CreateExchangeInvitation ¶
func CreateExchangeInvitation(input ExchangeInvitationInput) (*Exchange, error)
func CreateExchangeProblem ¶
func CreateExchangeProblem(input ExchangeProblemInput) (*Exchange, error)
func CreateExchangeRequest ¶
func CreateExchangeRequest(input ExchangeRequestResponseInput) (*Exchange, error)
func CreateExchangeResponse ¶
func CreateExchangeResponse(input ExchangeRequestResponseInput) (*Exchange, error)
type ExchangeCompleteInput ¶
type ExchangeInvitationInput ¶
type ExchangeProblemInput ¶
type ExchangeProblemInput struct { Label string ParentThreadID string `validate:"required"` ProblemCode ProblemCode `validate:"required"` Explain string `validate:"required"` }
type ExchangeRequestResponseInput ¶
type ExchangeRequestResponseInput struct { AdditionalContexts []string Label string DID did.DID `validate:"required"` LogoURL did.URI `validate:"required"` ConnectionName string `validate:"required"` ContactURL did.URI `validate:"required"` ParentThreadID string `validate:"required"` AttachmentData Data `validate:"required"` }
type JWS ¶
type JWS struct { Header map[string]interface{} `json:"header"` Protected string `json:"protected"` Signature string `json:"signature"` }
JWS Structure is JWS (RFC 7515) format and used for signing data.
type ProblemCode ¶
type ProblemCode string
const ( RequestNotAccepted ProblemCode = "request_not_accepted" RequestProcessingError ProblemCode = "request_processing_error" ResponseNotAccepted ProblemCode = "response_not_accepted" ResponseProcessingError ProblemCode = "response_processing_error" )