Documentation ¶
Overview ¶
Package bankid is a BankID API client for Go. For detailed API documentation checkout https://www.bankid.com/
Index ¶
- func NewTransport(caCertFilename string, clientCertFilename string, clientCertKeyFilename string) (*http.Transport, error)
- type AuthRequest
- type AuthResponse
- type CancelRequest
- type CancelResponse
- type Client
- func (c *Client) Auth(ctx context.Context, params *AuthRequest) (*AuthResponse, error)
- func (c *Client) Cancel(ctx context.Context, params *CancelRequest) (*CancelResponse, error)
- func (c *Client) Collect(ctx context.Context, params *CollectRequest) (*CollectResponse, error)
- func (c *Client) Sign(ctx context.Context, params *SignRequest) (*SignResponse, error)
- type CollectRequest
- type CollectResponse
- type ErrorResponse
- type SignRequest
- type SignResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AuthRequest ¶
type AuthRequest struct { // The user IP address as seen by RP. String. IPv4 and IPv6 is allowed. // Note the importance of using the correct IP address. // It must be the IP address representing the user agent (the end user device) // as seen by the RP. If there is a proxy for inbound traffic, special considerations // may need to be taken to get the correct address. // In some use cases the IP address is not available, // for instance for voice based services. In this case, // the internal representation of those systems IP address is ok to use. EndUserIp string `json:"endUserIp"` // The personal number of the user. String. 12 digits. // Century must be included. If the personal number is excluded, // the client must be started with the autoStartToken returned in the response. PersonalNumber string `json:"personalNumber,omitempty"` // Requirements on how the auth or sign order must be performed. Requirement string `json:"requirement,omitempty"` }
type AuthResponse ¶
type CancelRequest ¶
type CancelRequest struct { // The orderRef returned from auth or sign. OrderRef string `json:"orderRef"` }
type CancelResponse ¶
type CancelResponse struct { }
type Client ¶
func NewCertClient ¶
func NewCertClient(caCertFilename string, clientCertFilename string, clientCertKeyFilename string) (*Client, error)
NewCertClient returns a BankID API client with given certificates
func NewClient ¶
NewClient returns a BankID API client using the given http.Client.
Use this function if you want to specify your own client, else use NewCertClient.
func (*Client) Auth ¶
func (c *Client) Auth(ctx context.Context, params *AuthRequest) (*AuthResponse, error)
func (*Client) Cancel ¶
func (c *Client) Cancel(ctx context.Context, params *CancelRequest) (*CancelResponse, error)
func (*Client) Collect ¶
func (c *Client) Collect(ctx context.Context, params *CollectRequest) (*CollectResponse, error)
func (*Client) Sign ¶
func (c *Client) Sign(ctx context.Context, params *SignRequest) (*SignResponse, error)
type CollectRequest ¶
type CollectRequest struct { // The orderRef returned from auth or sign. OrderRef string `json:"orderRef"` }
type CollectResponse ¶
type CollectResponse struct { OrderRef string `json:"orderRef"` Status string `json:"status"` HintCode string `json:"hintCode"` CompletionData struct { User struct { PersonalNumber string `json:"personalNumber"` Name string `json:"name"` GivenName string `json:"givenName"` Surname string `json:"surname"` } `json:"user"` Device struct { IPAddress string `json:"ipAddress"` } `json:"device"` Cert struct { NotBefore string `json:"notBefore"` NotAfter string `json:"notAfter"` } `json:"cert"` Signature string `json:"signature"` OcspResponse string `json:"ocspResponse"` } `json:"completionData"` }
type ErrorResponse ¶
type ErrorResponse struct { // HTTP response that caused this error Response *http.Response ErrorCode string `json:"errorCode"` Details string `json:"details"` }
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type SignRequest ¶
type SignRequest struct { // The user IP address as seen by RP. String. IPv4 and IPv6 is allowed. // Note the importance of using the correct IP address. // It must be the IP address representing the user agent (the end user device) // as seen by the RP. If there is a proxy for inbound traffic, special considerations // may need to be taken to get the correct address. // In some use cases the IP address is not available, // for instance for voice based services. In this case, // the internal representation of those systems IP address is ok to use. EndUserIp string `json:"endUserIp"` // The personal number of the user. String. 12 digits. // Century must be included. If the personal number is excluded, // the client must be started with the autoStartToken returned in the response. PersonalNumber string `json:"personalNumber,omitempty"` // Requirements on how the auth or sign order must be performed. Requirement string `json:"requirement,omitempty"` // The text to be displayed and signed. String. The text can be formatted using // CR, LF and CRLF for new lines. The text must be encoded as UTF-8 and then // base 64 encoded. 1--40 000 characters after base 64 encoding. UserVisibleData string `json:"userVisibleData,omitempty"` // Data not displayed to the user. String. The value must be base 64-encoded. // 1-200 000 characters after base 64-encoding. UserNonVisibleData string `json:"userNonVisibleData,omitempty"` // If present, and set to “simpleMarkdownV1”, this parameter indicates that // userVisibleData holds formatting characters which, if used correctly, // will make the text displayed with the user nicer to look at. UserVisibleDataFormat string `json:"userVisibleDataFormat,omitempty"` }
Click to show internal directories.
Click to hide internal directories.