Documentation
¶
Overview ¶
Package api provides primitives to interact the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen DO NOT EDIT.
Index ¶
- func RegisterHandlers(router runtime.EchoRouter, si ServerInterface)
- type ApiWrapper
- func (w *ApiWrapper) Decrypt(ctx echo.Context) error
- func (w *ApiWrapper) Encrypt(ctx echo.Context) error
- func (w *ApiWrapper) ExternalId(ctx echo.Context) error
- func (w *ApiWrapper) GenerateKeyPair(ctx echo.Context, params GenerateKeyPairParams) error
- func (w *ApiWrapper) PublicKey(ctx echo.Context, urn string) error
- func (w *ApiWrapper) Sign(ctx echo.Context) error
- func (w *ApiWrapper) SignJwt(ctx echo.Context) error
- func (w *ApiWrapper) Verify(ctx echo.Context) error
- type DecryptJSONRequestBody
- type DecryptRequest
- type DecryptResponse
- type EncryptJSONRequestBody
- type EncryptRequest
- type EncryptRequestSubject
- type EncryptResponse
- type EncryptResponseEntry
- type ExternalIdJSONRequestBody
- type ExternalIdRequest
- type ExternalIdResponse
- type GenerateKeyPairParams
- type Identifier
- type JWK
- type PublicKey
- type ServerInterface
- type ServerInterfaceWrapper
- func (w *ServerInterfaceWrapper) Decrypt(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) Encrypt(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) ExternalId(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GenerateKeyPair(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PublicKey(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) Sign(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) SignJwt(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) Verify(ctx echo.Context) error
- type SignJSONRequestBody
- type SignJwtJSONRequestBody
- type SignJwtRequest
- type SignRequest
- type SignResponse
- type VerifyJSONRequestBody
- type VerifyRequest
- type VerifyResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RegisterHandlers ¶
func RegisterHandlers(router runtime.EchoRouter, si ServerInterface)
RegisterHandlers adds each server route to the EchoRouter.
Types ¶
type ApiWrapper ¶
func (*ApiWrapper) Decrypt ¶
func (w *ApiWrapper) Decrypt(ctx echo.Context) error
Decrypt is the API handler function for decrypting a piece of data.
func (*ApiWrapper) Encrypt ¶
func (w *ApiWrapper) Encrypt(ctx echo.Context) error
Encrypt is the implementation of the REST service call POST /crypto/encrypt
func (*ApiWrapper) ExternalId ¶
func (w *ApiWrapper) ExternalId(ctx echo.Context) error
ExternalId is the API handler function for generating a unique external identifier for a given identifier and legalEntity.
func (*ApiWrapper) GenerateKeyPair ¶
func (w *ApiWrapper) GenerateKeyPair(ctx echo.Context, params GenerateKeyPairParams) error
GenerateKeyPair is the implementation of the REST service call POST /crypto/generate It returns the public key for the given legal entity in either PEM or JWK format depending on the accept-header. Default is PEM (backwards compatibility)
func (*ApiWrapper) PublicKey ¶
func (w *ApiWrapper) PublicKey(ctx echo.Context, urn string) error
PublicKey returns a public key for the given urn. The urn represents a legal entity. The api returns the public key either in PEM or JWK format. It uses the accept header to determine this. Default is PEM (text/plain), only when application/json is requested will it return JWK.
type DecryptJSONRequestBody ¶
type DecryptJSONRequestBody decryptJSONBody
DecryptRequestBody defines body for Decrypt for application/json ContentType.
type DecryptRequest ¶
type DecryptRequest struct {
CipherText string `json:"cipherText"`
CipherTextKey string `json:"cipherTextKey"`
LegalEntity Identifier `json:"legalEntity"`
Nonce string `json:"nonce"`
}
DecryptRequest defines model for DecryptRequest.
type DecryptResponse ¶
type DecryptResponse struct {
PlainText string `json:"plainText"`
}
DecryptResponse defines model for DecryptResponse.
type EncryptJSONRequestBody ¶
type EncryptJSONRequestBody encryptJSONBody
EncryptRequestBody defines body for Encrypt for application/json ContentType.
type EncryptRequest ¶
type EncryptRequest struct {
EncryptRequestSubjects []EncryptRequestSubject `json:"encryptRequestSubjects"`
PlainText string `json:"plainText"`
}
EncryptRequest defines model for EncryptRequest.
type EncryptRequestSubject ¶
type EncryptRequestSubject struct {
Jwk *JWK `json:"jwk,omitempty"`
LegalEntity Identifier `json:"legalEntity"`
PublicKey *PublicKey `json:"publicKey,omitempty"`
}
EncryptRequestSubject defines model for EncryptRequestSubject.
type EncryptResponse ¶
type EncryptResponse struct {
CipherText string `json:"cipherText"`
EncryptResponseEntries []EncryptResponseEntry `json:"encryptResponseEntries"`
Nonce string `json:"nonce"`
}
EncryptResponse defines model for EncryptResponse.
type EncryptResponseEntry ¶
type EncryptResponseEntry struct {
CipherTextKey string `json:"cipherTextKey"`
LegalEntity Identifier `json:"legalEntity"`
}
EncryptResponseEntry defines model for EncryptResponseEntry.
type ExternalIdJSONRequestBody ¶
type ExternalIdJSONRequestBody externalIdJSONBody
ExternalIdRequestBody defines body for ExternalId for application/json ContentType.
type ExternalIdRequest ¶
type ExternalIdRequest struct {
Actor Identifier `json:"actor"`
LegalEntity Identifier `json:"legalEntity"`
Subject Identifier `json:"subject"`
}
ExternalIdRequest defines model for ExternalIdRequest.
type ExternalIdResponse ¶
type ExternalIdResponse struct {
ExternalId string `json:"externalId"`
}
ExternalIdResponse defines model for ExternalIdResponse.
type GenerateKeyPairParams ¶
type GenerateKeyPairParams struct {
LegalEntity Identifier `json:"legalEntity"`
}
GenerateKeyPairParams defines parameters for GenerateKeyPair.
type JWK ¶
type JWK struct {
AdditionalProperties map[string]interface{} `json:"-"`
}
JWK defines model for JWK.
func (JWK) Get ¶
Getter for additional properties for JWK. Returns the specified element and whether it was found
func (JWK) MarshalJSON ¶
Override default JSON handling for JWK to handle AdditionalProperties
func (*JWK) UnmarshalJSON ¶
Override default JSON handling for JWK to handle AdditionalProperties
type ServerInterface ¶
type ServerInterface interface {
// decrypt a cipherText for the given legalEntity// (POST /crypto/decrypt)
Decrypt(ctx echo.Context) error
// encrypt a piece of data for a list of public keys/legalEntity's. A single symmetric keys will be used for all entries// (POST /crypto/encrypt)
Encrypt(ctx echo.Context) error
// calculate an externalId for a (custodian, subject, actor) triple// (POST /crypto/external_id)
ExternalId(ctx echo.Context) error
// Send a request for checking if the given combination has valid consent// (POST /crypto/generate)
GenerateKeyPair(ctx echo.Context, params GenerateKeyPairParams) error
// get the public key for a given organization. It returns the key in PEM or JWK form. This depends on the accept header used (text/plain vs application/json)// (GET /crypto/public_key/{urn})
PublicKey(ctx echo.Context, urn string) error
// sign a piece of data with the private key of the given legalEntity// (POST /crypto/sign)
Sign(ctx echo.Context) error
// sign a JWT payload with the private key of the given legalEntity// (POST /crypto/sign_jwt)
SignJwt(ctx echo.Context) error
// verify a signature given a public key, signature and the data// (POST /crypto/verify)
Verify(ctx echo.Context) error
}
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) Decrypt ¶
func (w *ServerInterfaceWrapper) Decrypt(ctx echo.Context) error
Decrypt converts echo context to params.
func (*ServerInterfaceWrapper) Encrypt ¶
func (w *ServerInterfaceWrapper) Encrypt(ctx echo.Context) error
Encrypt converts echo context to params.
func (*ServerInterfaceWrapper) ExternalId ¶
func (w *ServerInterfaceWrapper) ExternalId(ctx echo.Context) error
ExternalId converts echo context to params.
func (*ServerInterfaceWrapper) GenerateKeyPair ¶
func (w *ServerInterfaceWrapper) GenerateKeyPair(ctx echo.Context) error
GenerateKeyPair converts echo context to params.
func (*ServerInterfaceWrapper) PublicKey ¶
func (w *ServerInterfaceWrapper) PublicKey(ctx echo.Context) error
PublicKey converts echo context to params.
func (*ServerInterfaceWrapper) Sign ¶
func (w *ServerInterfaceWrapper) Sign(ctx echo.Context) error
Sign converts echo context to params.
type SignJSONRequestBody ¶
type SignJSONRequestBody signJSONBody
SignRequestBody defines body for Sign for application/json ContentType.
type SignJwtJSONRequestBody ¶
type SignJwtJSONRequestBody signJwtJSONBody
SignJwtRequestBody defines body for SignJwt for application/json ContentType.
type SignJwtRequest ¶
type SignJwtRequest struct {
Claims map[string]interface{} `json:"claims"`
LegalEntity Identifier `json:"legalEntity"`
}
SignJwtRequest defines model for SignJwtRequest.
type SignRequest ¶
type SignRequest struct {
LegalEntity Identifier `json:"legalEntity"`
PlainText string `json:"plainText"`
}
SignRequest defines model for SignRequest.
type SignResponse ¶
type SignResponse struct {
Signature string `json:"signature"`
}
SignResponse defines model for SignResponse.
type VerifyJSONRequestBody ¶
type VerifyJSONRequestBody verifyJSONBody
VerifyRequestBody defines body for Verify for application/json ContentType.
type VerifyRequest ¶
type VerifyRequest struct {
Jwk *JWK `json:"jwk,omitempty"`
PlainText string `json:"plainText"`
PublicKey *PublicKey `json:"publicKey,omitempty"`
Signature string `json:"signature"`
}
VerifyRequest defines model for VerifyRequest.
type VerifyResponse ¶
type VerifyResponse struct {
Outcome bool `json:"outcome"`
}
VerifyResponse defines model for VerifyResponse.