Documentation ¶
Index ¶
- Constants
- Variables
- type AuthorizationCode
- type CredentialConfiguration
- type CredentialDeferredRequest
- type CredentialDefinition
- type CredentialErrorResponse
- type CredentialOffer
- type CredentialOfferParameters
- type CredentialRequest
- type CredentialRespEnc
- type CredentialResponse
- type CredentialResponseError
- type CredentialSubject
- type DescriptiveURL
- type Display
- type Grants
- type IssuerMetadata
- type JwtKeyProofType
- type LocalizedCredential
- type PreAuthorizedCode
- type Proof
- type ProofType
- type TxCode
Constants ¶
View Source
const ( InvalidTransactionId = "invalid_transaction_id" IssuancePending = "issuance_pending" )
View Source
const ( ProofTypeJWT = "jwt" ProofTypeCWT = "cwt" ProofTypeLDPvP = "ldp_vp" )
View Source
const ( // Credential Error Options InvalidCredentialRequest = "invalid_credential_request" UnsupportedCredentialType = "unsupported_credential_type" UnsupportedCredentialFormat = "unsupported_credential_format" InvalidProof = "invalid_proof" InvalidEncryptionParameters = "invalid_encryption_parameters" )
Variables ¶
View Source
var ( ErrInvalidCredentialRequest = CredentialErrorResponse{ErrorMsg: InvalidCredentialRequest} ErrUnsupportedCredentialType = CredentialErrorResponse{ErrorMsg: UnsupportedCredentialType} ErrUnsupportedCredentialFormat = CredentialErrorResponse{ErrorMsg: UnsupportedCredentialFormat} ErrInvalidProof = CredentialErrorResponse{ErrorMsg: InvalidProof} ErrInvalidEncryptionParameters = CredentialErrorResponse{ErrorMsg: InvalidEncryptionParameters} )
Functions ¶
This section is empty.
Types ¶
type AuthorizationCode ¶
type AuthorizationCode struct {
IssuerState string `json:"issuer_state"`
}
type CredentialConfiguration ¶
type CredentialConfiguration struct { Format string `json:"format"` Scope string `json:"scope"` CryptographicBindingMethodsSupported []string `json:"cryptographic_binding_methods_supported"` CredentialSigningAlgValuesSupported []string `json:"credential_signing_alg_values_supported"` CredentialDefinition CredentialDefinition `json:"credential_definition"` ProofTypesSupported map[string]ProofType `json:"proof_types_supported"` Display []LocalizedCredential `json:"display"` Vct *string `json:"vct,omitempty"` Claims map[string]interface{} `json:"claims,omitempty"` Order []string `json:"order,omitempty"` ///Out of OID Spec, but useful Schema map[string]interface{} `json:"schema,omitempty"` //json Schema representation of payload Subject string `json:"topic,omitempty"` // Subject of the credential within the system }
type CredentialDeferredRequest ¶
type CredentialDeferredRequest struct {
TransactionID string `json:"transaction_id"`
}
type CredentialDefinition ¶
type CredentialDefinition struct { Context []string `json:"@context"` Type []string `json:"type"` CredentialSubject map[string]CredentialSubject `json:"credentialSubject,omitempty"` }
type CredentialErrorResponse ¶
type CredentialErrorResponse struct { ErrorMsg string `json:"error"` ErrorDesc *string `json:"error_description,omitempty"` }
func (CredentialErrorResponse) Error ¶
func (e CredentialErrorResponse) Error() string
type CredentialOffer ¶
type CredentialOffer struct { CredentialOfferUri string `json:"credential_offer_uri,omitempty"` CredentialOffer string `json:"credential_offer,omitempty"` }
func (*CredentialOffer) GetOfferParameters ¶
func (offering *CredentialOffer) GetOfferParameters() (*CredentialOfferParameters, error)
Extracts the Parameters of the offering link
type CredentialOfferParameters ¶
type CredentialOfferParameters struct { CredentialIssuer string `json:"credential_issuer"` Credentials []string `json:"credential_configuration_ids"` Grants Grants `json:"grants"` }
func (*CredentialOfferParameters) CreateOfferLink ¶
func (offerParameter *CredentialOfferParameters) CreateOfferLink() (*CredentialOffer, error)
func (*CredentialOfferParameters) GetIssuerMetadata ¶
func (offerParameter *CredentialOfferParameters) GetIssuerMetadata() (*IssuerMetadata, error)
type CredentialRequest ¶
type CredentialRequest struct { Format string `json:"format,omitempty"` CredentialIdentifier string `json:"credential_identifier,omitempty"` Proof *Proof `json:"proof,omitempty"` Vct *string `json:"vct,omitempty"` Claims map[string]interface{} `json:"claims,omitempty"` Order []string `json:"order,omitempty"` }
func (*CredentialRequest) CheckRequestValid ¶
type CredentialRespEnc ¶
type CredentialResponse ¶
type CredentialResponse struct { Format string `json:"format"` Credential interface{} `json:"credential,omitempty"` TransactionID string `json:"transaction_id,omitempty"` CNonce string `json:"c_nonce,omitempty"` CNonceExpiresIn int `json:"c_nonce_expires_in,omitempty"` NotificationId string `json:"notification_id,omitempty"` }
type CredentialResponseError ¶
type CredentialSubject ¶
type CredentialSubject struct {
Display []Display `json:"display,omitempty"`
}
type DescriptiveURL ¶
type Grants ¶
type Grants struct { AuthorizationCode *AuthorizationCode `json:"authorization_code,omitempty"` PreAuthorizedCode *PreAuthorizedCode `json:"urn:ietf:params:oauth:grant-type:pre-authorized_code,omitempty"` }
type IssuerMetadata ¶
type IssuerMetadata struct { CredentialIssuer string `json:"credential_issuer"` AuthorizationServers []string `json:"authorization_servers"` CredentialEndpoint string `json:"credential_endpoint"` BatchCredentialEndpoint *string `json:"batch_credential_endpoint"` DeferredCredentialEndpoint *string `json:"deferred_credential_endpoint"` NotificationEndpoint *string `json:"notification_endpoint"` CredentialResponseEncryption CredentialRespEnc `json:"credential_response_encryption"` Display []LocalizedCredential `json:"display"` CredentialIdentifiersSupported bool `json:"credential_identifiers_supported"` SignedMetadata *string `json:"signed_metadata"` CredentialConfigurationsSupported map[string]CredentialConfiguration `json:"credential_configurations_supported"` }
func (*IssuerMetadata) CredentialRequest ¶
func (metadata *IssuerMetadata) CredentialRequest(request CredentialRequest, token oauth.Token) (*CredentialResponse, error)
func (*IssuerMetadata) FindFittingAuthorizationServer ¶
func (metadata *IssuerMetadata) FindFittingAuthorizationServer(grant oauth.GrantType) (*oauth.OpenIdConfiguration, error)
type JwtKeyProofType ¶
type LocalizedCredential ¶
type LocalizedCredential struct { Name string `json:"name"` Locale string `json:"locale"` Logo DescriptiveURL `json:"logo,omitempty"` BackgroundColor string `json:"background_color,omitempty"` TextColor string `json:"text_color,omitempty"` }
type PreAuthorizedCode ¶
type Proof ¶
type Proof struct { ProofType string `json:"proof_type"` Jwt *string `json:"jwt"` Cwt *string `json:"cwt"` LdpVp *string `json:"ldp_vp"` }
func (*Proof) CheckProof ¶
Click to show internal directories.
Click to hide internal directories.