Skip to content
Snippets Groups Projects
Commit 4841ce88 authored by Fabian Seidl's avatar Fabian Seidl
Browse files

add generated code for etsi14 grpc

parent 858bd70d
Branches
Tags
2 merge requests!2Add openapi v3 spec and proto definition for etsi14,!1Move proto kms into ekms
Pipeline #164592 failed
version: v1
plugins:
- plugin: buf.build/grpc/go
out: go/grpc
opt:
- paths=source_relative
- plugin: buf.build/grpc-ecosystem/gateway
out: go/grpc
opt:
- paths=source_relative
- plugin: buf.build/grpc-ecosystem/openapiv2
out: openapiv2
opt:
- allow_merge=true
- merge_file_name=ekms_etsi14
# - generate_unbound_methods=true
# - include_package_in_tags=false
# dependencies
- plugin: buf.build/protocolbuffers/go
out: go/grpc
opt:
- paths=source_relative
version: v1
directories:
- proto
\ No newline at end of file
This diff is collapsed.
// Code generated by protoc-gen-grpc-gateway. DO NOT EDIT.
// source: etsi/etsi14.proto
/*
Package etsi14 is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
*/
package etsi14
import (
"context"
"io"
"net/http"
"github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
"github.com/grpc-ecosystem/grpc-gateway/v2/utilities"
"google.golang.org/grpc"
"google.golang.org/grpc/codes"
"google.golang.org/grpc/grpclog"
"google.golang.org/grpc/metadata"
"google.golang.org/grpc/status"
"google.golang.org/protobuf/proto"
)
// Suppress "imported and not used" errors
var _ codes.Code
var _ io.Reader
var _ status.Status
var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = metadata.Join
func request_ETSI14Service_GetStatus_0(ctx context.Context, marshaler runtime.Marshaler, client ETSI14ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetStatusRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["KME_hostname"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "KME_hostname")
}
protoReq.KMEHostname, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "KME_hostname", err)
}
val, ok = pathParams["slave_SAE_ID"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "slave_SAE_ID")
}
protoReq.Slave_SAE_ID, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "slave_SAE_ID", err)
}
msg, err := client.GetStatus(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ETSI14Service_GetStatus_0(ctx context.Context, marshaler runtime.Marshaler, server ETSI14ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetStatusRequest
var metadata runtime.ServerMetadata
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["KME_hostname"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "KME_hostname")
}
protoReq.KMEHostname, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "KME_hostname", err)
}
val, ok = pathParams["slave_SAE_ID"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "slave_SAE_ID")
}
protoReq.Slave_SAE_ID, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "slave_SAE_ID", err)
}
msg, err := server.GetStatus(ctx, &protoReq)
return msg, metadata, err
}
func request_ETSI14Service_GetKey_0(ctx context.Context, marshaler runtime.Marshaler, client ETSI14ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetKeyRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["KME_hostname"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "KME_hostname")
}
protoReq.KMEHostname, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "KME_hostname", err)
}
val, ok = pathParams["slave_SAE_ID"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "slave_SAE_ID")
}
protoReq.Slave_SAE_ID, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "slave_SAE_ID", err)
}
msg, err := client.GetKey(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ETSI14Service_GetKey_0(ctx context.Context, marshaler runtime.Marshaler, server ETSI14ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetKeyRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["KME_hostname"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "KME_hostname")
}
protoReq.KMEHostname, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "KME_hostname", err)
}
val, ok = pathParams["slave_SAE_ID"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "slave_SAE_ID")
}
protoReq.Slave_SAE_ID, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "slave_SAE_ID", err)
}
msg, err := server.GetKey(ctx, &protoReq)
return msg, metadata, err
}
func request_ETSI14Service_GetKeyWithIDs_0(ctx context.Context, marshaler runtime.Marshaler, client ETSI14ServiceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetKeyWithIDsRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["KME_hostname"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "KME_hostname")
}
protoReq.KMEHostname, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "KME_hostname", err)
}
val, ok = pathParams["master_SAE_ID"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "master_SAE_ID")
}
protoReq.Master_SAE_ID, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "master_SAE_ID", err)
}
msg, err := client.GetKeyWithIDs(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_ETSI14Service_GetKeyWithIDs_0(ctx context.Context, marshaler runtime.Marshaler, server ETSI14ServiceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetKeyWithIDsRequest
var metadata runtime.ServerMetadata
newReader, berr := utilities.IOReaderFactory(req.Body)
if berr != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", berr)
}
if err := marshaler.NewDecoder(newReader()).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
var (
val string
ok bool
err error
_ = err
)
val, ok = pathParams["KME_hostname"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "KME_hostname")
}
protoReq.KMEHostname, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "KME_hostname", err)
}
val, ok = pathParams["master_SAE_ID"]
if !ok {
return nil, metadata, status.Errorf(codes.InvalidArgument, "missing parameter %s", "master_SAE_ID")
}
protoReq.Master_SAE_ID, err = runtime.String(val)
if err != nil {
return nil, metadata, status.Errorf(codes.InvalidArgument, "type mismatch, parameter: %s, error: %v", "master_SAE_ID", err)
}
msg, err := server.GetKeyWithIDs(ctx, &protoReq)
return msg, metadata, err
}
// RegisterETSI14ServiceHandlerServer registers the http handlers for service ETSI14Service to "mux".
// UnaryRPC :call ETSI14ServiceServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterETSI14ServiceHandlerFromEndpoint instead.
func RegisterETSI14ServiceHandlerServer(ctx context.Context, mux *runtime.ServeMux, server ETSI14ServiceServer) error {
mux.Handle("GET", pattern_ETSI14Service_GetStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/danet.etsi.ETSI14Service/GetStatus", runtime.WithHTTPPathPattern("/{KME_hostname}/api/v1/keys/{slave_SAE_ID}/status"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ETSI14Service_GetStatus_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ETSI14Service_GetStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_ETSI14Service_GetKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/danet.etsi.ETSI14Service/GetKey", runtime.WithHTTPPathPattern("/{KME_hostname}/api/v1/keys/{slave_SAE_ID}/enc_keys"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ETSI14Service_GetKey_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ETSI14Service_GetKey_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_ETSI14Service_GetKeyWithIDs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/danet.etsi.ETSI14Service/GetKeyWithIDs", runtime.WithHTTPPathPattern("/{KME_hostname}/api/v1/keys/{master_SAE_ID}/dec_keys"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_ETSI14Service_GetKeyWithIDs_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ETSI14Service_GetKeyWithIDs_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
// RegisterETSI14ServiceHandlerFromEndpoint is same as RegisterETSI14ServiceHandler but
// automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterETSI14ServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error) {
conn, err := grpc.DialContext(ctx, endpoint, opts...)
if err != nil {
return err
}
defer func() {
if err != nil {
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
return
}
go func() {
<-ctx.Done()
if cerr := conn.Close(); cerr != nil {
grpclog.Infof("Failed to close conn to %s: %v", endpoint, cerr)
}
}()
}()
return RegisterETSI14ServiceHandler(ctx, mux, conn)
}
// RegisterETSI14ServiceHandler registers the http handlers for service ETSI14Service to "mux".
// The handlers forward requests to the grpc endpoint over "conn".
func RegisterETSI14ServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error {
return RegisterETSI14ServiceHandlerClient(ctx, mux, NewETSI14ServiceClient(conn))
}
// RegisterETSI14ServiceHandlerClient registers the http handlers for service ETSI14Service
// to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "ETSI14ServiceClient".
// Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "ETSI14ServiceClient"
// doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in
// "ETSI14ServiceClient" to call the correct interceptors.
func RegisterETSI14ServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client ETSI14ServiceClient) error {
mux.Handle("GET", pattern_ETSI14Service_GetStatus_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/danet.etsi.ETSI14Service/GetStatus", runtime.WithHTTPPathPattern("/{KME_hostname}/api/v1/keys/{slave_SAE_ID}/status"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ETSI14Service_GetStatus_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ETSI14Service_GetStatus_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_ETSI14Service_GetKey_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/danet.etsi.ETSI14Service/GetKey", runtime.WithHTTPPathPattern("/{KME_hostname}/api/v1/keys/{slave_SAE_ID}/enc_keys"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ETSI14Service_GetKey_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ETSI14Service_GetKey_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_ETSI14Service_GetKeyWithIDs_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/danet.etsi.ETSI14Service/GetKeyWithIDs", runtime.WithHTTPPathPattern("/{KME_hostname}/api/v1/keys/{master_SAE_ID}/dec_keys"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_ETSI14Service_GetKeyWithIDs_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_ETSI14Service_GetKeyWithIDs_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
var (
pattern_ETSI14Service_GetStatus_0 = runtime.MustPattern(runtime.NewPattern(1, []int{1, 0, 4, 1, 5, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"KME_hostname", "api", "v1", "keys", "slave_SAE_ID", "status"}, ""))
pattern_ETSI14Service_GetKey_0 = runtime.MustPattern(runtime.NewPattern(1, []int{1, 0, 4, 1, 5, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"KME_hostname", "api", "v1", "keys", "slave_SAE_ID", "enc_keys"}, ""))
pattern_ETSI14Service_GetKeyWithIDs_0 = runtime.MustPattern(runtime.NewPattern(1, []int{1, 0, 4, 1, 5, 0, 2, 1, 2, 2, 2, 3, 1, 0, 4, 1, 5, 4, 2, 5}, []string{"KME_hostname", "api", "v1", "keys", "master_SAE_ID", "dec_keys"}, ""))
)
var (
forward_ETSI14Service_GetStatus_0 = runtime.ForwardResponseMessage
forward_ETSI14Service_GetKey_0 = runtime.ForwardResponseMessage
forward_ETSI14Service_GetKeyWithIDs_0 = runtime.ForwardResponseMessage
)
// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.3.0
// - protoc (unknown)
// source: etsi/etsi14.proto
package etsi14
import (
context "context"
grpc "google.golang.org/grpc"
codes "google.golang.org/grpc/codes"
status "google.golang.org/grpc/status"
)
// This is a compile-time assertion to ensure that this generated file
// is compatible with the grpc package it is being compiled against.
// Requires gRPC-Go v1.32.0 or later.
const _ = grpc.SupportPackageIsVersion7
const (
ETSI14Service_GetStatus_FullMethodName = "/danet.etsi.ETSI14Service/GetStatus"
ETSI14Service_GetKey_FullMethodName = "/danet.etsi.ETSI14Service/GetKey"
ETSI14Service_GetKeyWithIDs_FullMethodName = "/danet.etsi.ETSI14Service/GetKeyWithIDs"
)
// ETSI14ServiceClient is the client API for ETSI14Service service.
//
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type ETSI14ServiceClient interface {
// Returns Status from a KME to the calling SAE.
// Status contains information on keys available to be requested
// by a master SAE for a specified slave SAE.
GetStatus(ctx context.Context, in *GetStatusRequest, opts ...grpc.CallOption) (*GetStatusResponse, error)
// Returns Key container data from the KME to the calling master SAE.
// Key container data contains one or more keys. The calling master SAE may supply
// Key request data to specify the requirement on Key container data. The slave SAE
// specified by the slave_SAE_ID parameter may subsequently request matching keys
// from a remote KME using key_ID identifiers from the returned Key container.
GetKey(ctx context.Context, in *GetKeyRequest, opts ...grpc.CallOption) (*GetKeyResponse, error)
// Returns Key container from the KME to the calling slave SAE.
// Key container contains keys matching those previously delivered to a remote master SAE
// based on the Key IDs supplied from the remote master SAE in response to its call to Get key.
// The KME shall reject the request with a 401 HTTP status code if the SAE ID of the requestor
// was not an SAE ID supplied to the "Get key" method each time it was called resulting in the
// return of any of the Key IDs being requested.
GetKeyWithIDs(ctx context.Context, in *GetKeyWithIDsRequest, opts ...grpc.CallOption) (*GetKeyWithIDsResponse, error)
}
type eTSI14ServiceClient struct {
cc grpc.ClientConnInterface
}
func NewETSI14ServiceClient(cc grpc.ClientConnInterface) ETSI14ServiceClient {
return &eTSI14ServiceClient{cc}
}
func (c *eTSI14ServiceClient) GetStatus(ctx context.Context, in *GetStatusRequest, opts ...grpc.CallOption) (*GetStatusResponse, error) {
out := new(GetStatusResponse)
err := c.cc.Invoke(ctx, ETSI14Service_GetStatus_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *eTSI14ServiceClient) GetKey(ctx context.Context, in *GetKeyRequest, opts ...grpc.CallOption) (*GetKeyResponse, error) {
out := new(GetKeyResponse)
err := c.cc.Invoke(ctx, ETSI14Service_GetKey_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *eTSI14ServiceClient) GetKeyWithIDs(ctx context.Context, in *GetKeyWithIDsRequest, opts ...grpc.CallOption) (*GetKeyWithIDsResponse, error) {
out := new(GetKeyWithIDsResponse)
err := c.cc.Invoke(ctx, ETSI14Service_GetKeyWithIDs_FullMethodName, in, out, opts...)
if err != nil {
return nil, err
}
return out, nil
}
// ETSI14ServiceServer is the server API for ETSI14Service service.
// All implementations must embed UnimplementedETSI14ServiceServer
// for forward compatibility
type ETSI14ServiceServer interface {
// Returns Status from a KME to the calling SAE.
// Status contains information on keys available to be requested
// by a master SAE for a specified slave SAE.
GetStatus(context.Context, *GetStatusRequest) (*GetStatusResponse, error)
// Returns Key container data from the KME to the calling master SAE.
// Key container data contains one or more keys. The calling master SAE may supply
// Key request data to specify the requirement on Key container data. The slave SAE
// specified by the slave_SAE_ID parameter may subsequently request matching keys
// from a remote KME using key_ID identifiers from the returned Key container.
GetKey(context.Context, *GetKeyRequest) (*GetKeyResponse, error)
// Returns Key container from the KME to the calling slave SAE.
// Key container contains keys matching those previously delivered to a remote master SAE
// based on the Key IDs supplied from the remote master SAE in response to its call to Get key.
// The KME shall reject the request with a 401 HTTP status code if the SAE ID of the requestor
// was not an SAE ID supplied to the "Get key" method each time it was called resulting in the
// return of any of the Key IDs being requested.
GetKeyWithIDs(context.Context, *GetKeyWithIDsRequest) (*GetKeyWithIDsResponse, error)
mustEmbedUnimplementedETSI14ServiceServer()
}
// UnimplementedETSI14ServiceServer must be embedded to have forward compatible implementations.
type UnimplementedETSI14ServiceServer struct {
}
func (UnimplementedETSI14ServiceServer) GetStatus(context.Context, *GetStatusRequest) (*GetStatusResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetStatus not implemented")
}
func (UnimplementedETSI14ServiceServer) GetKey(context.Context, *GetKeyRequest) (*GetKeyResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetKey not implemented")
}
func (UnimplementedETSI14ServiceServer) GetKeyWithIDs(context.Context, *GetKeyWithIDsRequest) (*GetKeyWithIDsResponse, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetKeyWithIDs not implemented")
}
func (UnimplementedETSI14ServiceServer) mustEmbedUnimplementedETSI14ServiceServer() {}
// UnsafeETSI14ServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to ETSI14ServiceServer will
// result in compilation errors.
type UnsafeETSI14ServiceServer interface {
mustEmbedUnimplementedETSI14ServiceServer()
}
func RegisterETSI14ServiceServer(s grpc.ServiceRegistrar, srv ETSI14ServiceServer) {
s.RegisterService(&ETSI14Service_ServiceDesc, srv)
}
func _ETSI14Service_GetStatus_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetStatusRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ETSI14ServiceServer).GetStatus(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ETSI14Service_GetStatus_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ETSI14ServiceServer).GetStatus(ctx, req.(*GetStatusRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ETSI14Service_GetKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetKeyRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ETSI14ServiceServer).GetKey(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ETSI14Service_GetKey_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ETSI14ServiceServer).GetKey(ctx, req.(*GetKeyRequest))
}
return interceptor(ctx, in, info, handler)
}
func _ETSI14Service_GetKeyWithIDs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetKeyWithIDsRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(ETSI14ServiceServer).GetKeyWithIDs(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: ETSI14Service_GetKeyWithIDs_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(ETSI14ServiceServer).GetKeyWithIDs(ctx, req.(*GetKeyWithIDsRequest))
}
return interceptor(ctx, in, info, handler)
}
// ETSI14Service_ServiceDesc is the grpc.ServiceDesc for ETSI14Service service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var ETSI14Service_ServiceDesc = grpc.ServiceDesc{
ServiceName: "danet.etsi.ETSI14Service",
HandlerType: (*ETSI14ServiceServer)(nil),
Methods: []grpc.MethodDesc{
{
MethodName: "GetStatus",
Handler: _ETSI14Service_GetStatus_Handler,
},
{
MethodName: "GetKey",
Handler: _ETSI14Service_GetKey_Handler,
},
{
MethodName: "GetKeyWithIDs",
Handler: _ETSI14Service_GetKeyWithIDs_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "etsi/etsi14.proto",
}
{
"swagger": "2.0",
"info": {
"title": "danet ETSI14 Interface",
"description": "Protocol Buffer specifications and Go code for the ETSI14 KMS Interface",
"version": "0.1",
"contact": {
"name": "danet research group"
},
"license": {
"name": "BSD 3-Clause License"
}
},
"tags": [
{
"name": "ETSI14Service"
}
],
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"paths": {
"/{KMEHostname}/api/v1/keys/{masterSAEID}/dec_keys": {
"post": {
"summary": "Returns Key container from the KME to the calling slave SAE. \nKey container contains keys matching those previously delivered to a remote master SAE\nbased on the Key IDs supplied from the remote master SAE in response to its call to Get key.\nThe KME shall reject the request with a 401 HTTP status code if the SAE ID of the requestor \nwas not an SAE ID supplied to the \"Get key\" method each time it was called resulting in the\nreturn of any of the Key IDs being requested.",
"operationId": "ETSI14Service_GetKeyWithIDs",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/etsiGetKeyWithIDsResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/googlerpcStatus"
}
}
},
"parameters": [
{
"name": "KMEHostname",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "masterSAEID",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"slaveSAEID": {
"type": "string"
},
"keyID": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/etsiKeyID"
}
}
}
}
}
],
"tags": [
"ETSI14Service"
]
}
},
"/{KMEHostname}/api/v1/keys/{slaveSAEID}/enc_keys": {
"post": {
"summary": "Returns Key container data from the KME to the calling master SAE. \nKey container data contains one or more keys. The calling master SAE may supply \nKey request data to specify the requirement on Key container data. The slave SAE \nspecified by the slave_SAE_ID parameter may subsequently request matching keys \nfrom a remote KME using key_ID identifiers from the returned Key container.",
"operationId": "ETSI14Service_GetKey",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/etsiGetKeyResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/googlerpcStatus"
}
}
},
"parameters": [
{
"name": "KMEHostname",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "slaveSAEID",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"type": "object",
"properties": {
"keyRequest": {
"$ref": "#/definitions/etsiKeyRequest"
}
}
}
}
],
"tags": [
"ETSI14Service"
]
}
},
"/{KMEHostname}/api/v1/keys/{slaveSAEID}/status": {
"get": {
"summary": "Returns Status from a KME to the calling SAE. \nStatus contains information on keys available to be requested \nby a master SAE for a specified slave SAE.",
"operationId": "ETSI14Service_GetStatus",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/etsiGetStatusResponse"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/googlerpcStatus"
}
}
},
"parameters": [
{
"name": "KMEHostname",
"in": "path",
"required": true,
"type": "string"
},
{
"name": "slaveSAEID",
"in": "path",
"required": true,
"type": "string"
}
],
"tags": [
"ETSI14Service"
]
}
}
},
"definitions": {
"danetetsiStatus": {
"type": "object",
"properties": {
"sourceKMEID": {
"type": "string"
},
"targetKMEID": {
"type": "string"
},
"masterSAEID": {
"type": "string"
},
"slaveSAEID": {
"type": "string"
},
"keySize": {
"type": "string",
"format": "int64"
},
"storedKeyCount": {
"type": "string",
"format": "int64"
},
"maxKeyCount": {
"type": "string",
"format": "int64"
},
"maxKeyPerRequest": {
"type": "string",
"format": "int64"
},
"maxKeySize": {
"type": "string",
"format": "int64"
},
"minKeySize": {
"type": "string",
"format": "int64"
},
"maxSAEIDCount": {
"type": "string",
"format": "int64"
}
}
},
"etsiError": {
"type": "object",
"properties": {
"message": {
"type": "string",
"title": "ErrorCode code = 1;"
},
"details": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/etsiListOfDetails"
},
"title": "maybe map\u003cstring, string\u003e is enough here?!"
}
},
"title": "FIGURE THIS ERROR STUFF OUT"
},
"etsiExtensionMandatory": {
"type": "object",
"properties": {
"extensionMandatory": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/protobufAny"
}
}
},
"description": "Array of extension parameters specified as name/value pairs that KME shall \nhandle or return an error. Parameter values may be of any type, including objects."
},
"etsiExtensionOptional": {
"type": "object",
"properties": {
"extensionOptional": {
"type": "object",
"additionalProperties": {
"$ref": "#/definitions/protobufAny"
}
}
},
"description": "Array of extension parameters specified as name/value pairs that KME may ignore. \nParameter values may be of any type, including objects."
},
"etsiGetKeyResponse": {
"type": "object",
"properties": {
"timestamp": {
"type": "string",
"format": "int64"
},
"keyContainer": {
"$ref": "#/definitions/etsiKeyContainer"
},
"error": {
"$ref": "#/definitions/etsiError"
}
}
},
"etsiGetKeyWithIDsResponse": {
"type": "object",
"properties": {
"timestamp": {
"type": "string",
"format": "int64"
},
"keyContainer": {
"$ref": "#/definitions/etsiKeyContainer"
},
"error": {
"$ref": "#/definitions/etsiError"
}
}
},
"etsiGetStatusResponse": {
"type": "object",
"properties": {
"timestamp": {
"type": "string",
"format": "int64"
},
"status": {
"$ref": "#/definitions/danetetsiStatus"
},
"error": {
"$ref": "#/definitions/etsiError"
}
}
},
"etsiKey": {
"type": "object",
"properties": {
"keyID": {
"type": "string"
},
"keyIDExtension": {
"$ref": "#/definitions/etsiKeyIDExtension"
},
"key": {
"type": "string"
},
"keyExtension": {
"$ref": "#/definitions/protobufAny"
}
}
},
"etsiKeyContainer": {
"type": "object",
"properties": {
"key": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/etsiKey"
}
},
"keyContainerExtension": {
"$ref": "#/definitions/protobufAny"
}
}
},
"etsiKeyID": {
"type": "object",
"properties": {
"keyID": {
"type": "string"
},
"keyIDExtension": {
"$ref": "#/definitions/protobufAny"
}
}
},
"etsiKeyIDExtension": {
"type": "object",
"description": "optional for future use."
},
"etsiKeyRequest": {
"type": "object",
"properties": {
"number": {
"type": "string",
"format": "int64"
},
"size": {
"type": "string",
"format": "int64"
},
"additionalSlaveSAEIDs": {
"type": "array",
"items": {
"type": "string"
}
},
"extensionMandatory": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/etsiExtensionMandatory"
}
},
"extensionOptional": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/etsiExtensionOptional"
}
}
}
},
"etsiListOfDetails": {
"type": "object",
"properties": {
"details": {
"type": "array",
"items": {
"type": "string"
}
}
},
"title": "Maybe not neccessary"
},
"googlerpcStatus": {
"type": "object",
"properties": {
"code": {
"type": "integer",
"format": "int32"
},
"message": {
"type": "string"
},
"details": {
"type": "array",
"items": {
"type": "object",
"$ref": "#/definitions/protobufAny"
}
}
}
},
"protobufAny": {
"type": "object",
"properties": {
"@type": {
"type": "string",
"description": "A URL/resource name that uniquely identifies the type of the serialized\nprotocol buffer message. This string must contain at least\none \"/\" character. The last segment of the URL's path must represent\nthe fully qualified name of the type (as in\n`path/google.protobuf.Duration`). The name should be in a canonical form\n(e.g., leading \".\" is not accepted).\n\nIn practice, teams usually precompile into the binary all types that they\nexpect it to use in the context of Any. However, for URLs which use the\nscheme `http`, `https`, or no scheme, one can optionally set up a type\nserver that maps type URLs to message definitions as follows:\n\n* If no scheme is provided, `https` is assumed.\n* An HTTP GET on the URL must yield a [google.protobuf.Type][]\n value in binary format, or produce an error.\n* Applications are allowed to cache lookup results based on the\n URL, or have them precompiled into a binary to avoid any\n lookup. Therefore, binary compatibility needs to be preserved\n on changes to types. (Use versioned type names to manage\n breaking changes.)\n\nNote: this functionality is not currently available in the official\nprotobuf release, and it is not used for type URLs beginning with\ntype.googleapis.com.\n\nSchemes other than `http`, `https` (or the empty scheme) might be\nused with implementation specific semantics."
}
},
"additionalProperties": {},
"description": "`Any` contains an arbitrary serialized protocol buffer message along with a\nURL that describes the type of the serialized message.\n\nProtobuf library provides support to pack/unpack Any values in the form\nof utility functions or additional generated methods of the Any type.\n\nExample 1: Pack and unpack a message in C++.\n\n Foo foo = ...;\n Any any;\n any.PackFrom(foo);\n ...\n if (any.UnpackTo(\u0026foo)) {\n ...\n }\n\nExample 2: Pack and unpack a message in Java.\n\n Foo foo = ...;\n Any any = Any.pack(foo);\n ...\n if (any.is(Foo.class)) {\n foo = any.unpack(Foo.class);\n }\n // or ...\n if (any.isSameTypeAs(Foo.getDefaultInstance())) {\n foo = any.unpack(Foo.getDefaultInstance());\n }\n\nExample 3: Pack and unpack a message in Python.\n\n foo = Foo(...)\n any = Any()\n any.Pack(foo)\n ...\n if any.Is(Foo.DESCRIPTOR):\n any.Unpack(foo)\n ...\n\nExample 4: Pack and unpack a message in Go\n\n foo := \u0026pb.Foo{...}\n any, err := anypb.New(foo)\n if err != nil {\n ...\n }\n ...\n foo := \u0026pb.Foo{}\n if err := any.UnmarshalTo(foo); err != nil {\n ...\n }\n\nThe pack methods provided by protobuf library will by default use\n'type.googleapis.com/full.type.name' as the type URL and the unpack\nmethods only use the fully qualified type name after the last '/'\nin the type URL, for example \"foo.bar.com/x/y.z\" will yield type\nname \"y.z\".\n\nJSON\n\nThe JSON representation of an `Any` value uses the regular\nrepresentation of the deserialized, embedded message, with an\nadditional field `@type` which contains the type URL. Example:\n\n package google.profile;\n message Person {\n string first_name = 1;\n string last_name = 2;\n }\n\n {\n \"@type\": \"type.googleapis.com/google.profile.Person\",\n \"firstName\": \u003cstring\u003e,\n \"lastName\": \u003cstring\u003e\n }\n\nIf the embedded message type is well-known and has a custom JSON\nrepresentation, that representation will be embedded adding a field\n`value` which holds the custom JSON in addition to the `@type`\nfield. Example (for message [google.protobuf.Duration][]):\n\n {\n \"@type\": \"type.googleapis.com/google.protobuf.Duration\",\n \"value\": \"1.212s\"\n }"
}
}
}
# Generated by buf. DO NOT EDIT.
version: v1
deps:
- remote: buf.build
owner: bufbuild
repository: protovalidate
commit: 0de7443d03cf41228f8a9790b12b417e
digest: shake256:3c0676a73cef06439c107cb9560627354815adbc254976f807d645de7e2c1bf19d0438d5d56d5bc92465377e0d9315951e986fc6ced2871e450534b2b8c953b0
- remote: buf.build
owner: googleapis
repository: googleapis
commit: 28151c0d0a1641bf938a7672c500e01d
digest: shake256:49215edf8ef57f7863004539deff8834cfb2195113f0b890dd1f67815d9353e28e668019165b9d872395871eeafcbab3ccfdb2b5f11734d3cca95be9e8d139de
- remote: buf.build
owner: grpc-ecosystem
repository: grpc-gateway
commit: 048ae6ff94ca4476b3225904b1078fad
digest: shake256:e5250bf2d999516c02206d757502b902e406f35c099d0e869dc3e4f923f6870fe0805a9974c27df0695462937eae90cd4d9db90bb9a03489412560baa74a87b6
version: v1
deps:
- buf.build/googleapis/googleapis
- buf.build/grpc-ecosystem/grpc-gateway
- buf.build/bufbuild/protovalidate
lint:
use:
- DEFAULT
breaking:
use:
- FILE
syntax = "proto3";
package danet.etsi;
import "google/api/annotations.proto";
import "google/protobuf/descriptor.proto";
import "protoc-gen-openapiv2/options/annotations.proto";
import "google/protobuf/any.proto";
option go_package = "code.fbi.h-da.de/danet/etsi/api/go/etsi14";
option (grpc.gateway.protoc_gen_openapiv2.options.openapiv2_swagger) = {
info: {
title: "danet ETSI14 Interface";
description: "Protocol Buffer specifications and Go code for the ETSI14 KMS Interface"
version: "0.1";
contact: {
name: "danet research group";
//TODO: ADD PROPER URL AND MAIL
//url: "https://code.fbi.h-da.de/danet/api";
//email: "none@example.com";
};
license: {
name: "BSD 3-Clause License";
// TODO: ADD PROPER LICENSE LINK
//url: "https://code.fbi.h-da.de/danet/api/-/blob/master/LICENSE";
};
};
};
service ETSI14Service {
// Returns Status from a KME to the calling SAE.
// Status contains information on keys available to be requested
// by a master SAE for a specified slave SAE.
rpc GetStatus(GetStatusRequest) returns (GetStatusResponse) {
option (google.api.http) = {
get: "/{KME_hostname}/api/v1/keys/{slave_SAE_ID}/status"
};
}
// Returns Key container data from the KME to the calling master SAE.
// Key container data contains one or more keys. The calling master SAE may supply
// Key request data to specify the requirement on Key container data. The slave SAE
// specified by the slave_SAE_ID parameter may subsequently request matching keys
// from a remote KME using key_ID identifiers from the returned Key container.
rpc GetKey(GetKeyRequest) returns (GetKeyResponse) {
option (google.api.http) = {
post: "/{KME_hostname}/api/v1/keys/{slave_SAE_ID}/enc_keys"
body: "*"
};
}
// Returns Key container from the KME to the calling slave SAE.
// Key container contains keys matching those previously delivered to a remote master SAE
// based on the Key IDs supplied from the remote master SAE in response to its call to Get key.
// The KME shall reject the request with a 401 HTTP status code if the SAE ID of the requestor
// was not an SAE ID supplied to the "Get key" method each time it was called resulting in the
// return of any of the Key IDs being requested.
rpc GetKeyWithIDs(GetKeyWithIDsRequest) returns (GetKeyWithIDsResponse) {
option (google.api.http) = {
post: "/{KME_hostname}/api/v1/keys/{master_SAE_ID}/dec_keys"
body: "*"
};
}
}
message GetStatusRequest {
string KME_hostname = 1;
string slave_SAE_ID = 2;
}
message GetStatusResponse {
int64 timestamp = 1;
Status status = 2;
Error error = 3;
}
message GetKeyRequest {
string KME_hostname = 1;
string slave_SAE_ID = 2;
KeyRequest key_request = 3;
}
message GetKeyResponse {
int64 timestamp = 1;
KeyContainer key_container = 2;
Error error = 3;
}
message GetKeyWithIDsRequest {
string KME_hostname = 1;
string master_SAE_ID = 2;
string slave_SAE_ID = 3;
repeated KeyID key_ID = 4;
}
message GetKeyWithIDsResponse {
int64 timestamp = 1;
KeyContainer key_container = 2;
Error error = 3;
}
// FIGURE THIS ERROR STUFF OUT
message Error {
// ErrorCode code = 1;
string message = 1;
map<string, ListOfDetails> details = 2; // maybe map<string, string> is enough here?!
// or also google.protobuf.Any?
}
// Maybe not neccessary
message ListOfDetails {
repeated string details = 1;
}
// // FIGURE THIS ERROR STUFF OUT
// enum ErrorCode {
// }
message Status {
string source_KME_ID = 1;
string target_KME_ID = 2;
string master_SAE_ID = 3;
string slave_SAE_ID = 4;
int64 key_size = 5;
int64 stored_key_count = 6;
int64 max_key_count = 7;
int64 max_key_per_request = 8;
int64 max_key_size = 9;
int64 min_key_size = 10;
int64 max_SAE_ID_count = 11;
}
message KeyRequest {
int64 number = 1;
int64 size = 2;
repeated string additional_slave_SAE_IDs = 3;
repeated ExtensionMandatory extension_mandatory = 4;
repeated ExtensionOptional extension_optional = 5;
}
// Array of extension parameters specified as name/value pairs that KME shall
// handle or return an error. Parameter values may be of any type, including objects.
message ExtensionMandatory {
map<string, google.protobuf.Any> extension_mandatory = 1;
}
// Array of extension parameters specified as name/value pairs that KME may ignore.
// Parameter values may be of any type, including objects.
message ExtensionOptional {
map<string, google.protobuf.Any> extension_optional = 1;
}
message KeyID {
string key_ID = 1;
google.protobuf.Any key_ID_extension = 2;
}
message KeyContainer {
repeated Key key = 1;
google.protobuf.Any key_container_extension = 2;
}
message KeyIDExtension {
// optional for future use.
}
message Key {
string key_ID = 1;
KeyIDExtension key_ID_extension = 2;
string key = 3;
google.protobuf.Any key_extension = 4;
}
\ No newline at end of file
......@@ -6,6 +6,7 @@ require (
code.fbi.h-da.de/danet/gnmi-target v0.0.0-20231020162329-e5679b7b675b
code.fbi.h-da.de/danet/proto-kms v0.0.0-20231010134253-1aaf11da29b9
github.com/google/uuid v1.3.1
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0
github.com/openconfig/gnmi v0.10.0
github.com/openconfig/goyang v1.4.2
github.com/openconfig/ygot v0.29.12
......@@ -15,6 +16,9 @@ require (
github.com/spf13/cobra v1.7.0
github.com/spf13/viper v1.17.0
golang.org/x/sys v0.13.0
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb
google.golang.org/grpc v1.58.2
google.golang.org/protobuf v1.31.0
gopkg.in/yaml.v3 v3.0.1
)
......@@ -45,8 +49,7 @@ require (
golang.org/x/exp v0.0.0-20230905200255-921286631fa9 // indirect
golang.org/x/net v0.15.0 // indirect
golang.org/x/text v0.13.0 // indirect
google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb // indirect
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 // indirect
google.golang.org/grpc v1.58.2 // indirect
google.golang.org/protobuf v1.31.0 // indirect
gopkg.in/ini.v1 v1.67.0 // indirect
)
......@@ -136,6 +136,8 @@ github.com/google/uuid v1.3.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+
github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
github.com/googleapis/google-cloud-go-testing v0.0.0-20200911160855-bcd43fbb19e8/go.mod h1:dvDLG8qkwmyD9a/MJJN3XJcT3xFxOKAvTZGvuZmac9g=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0 h1:RtRsiaGvWxcwd8y3BiRZxsylPT8hLWZ5SPcfI+3IDNk=
github.com/grpc-ecosystem/grpc-gateway/v2 v2.18.0/go.mod h1:TzP6duP4Py2pHLVPPQp42aoYI92+PCrVotyR5e8Vqlk=
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
......@@ -502,6 +504,10 @@ google.golang.org/genproto v0.0.0-20201210142538-e3217bee35cc/go.mod h1:FWY/as6D
google.golang.org/genproto v0.0.0-20201214200347-8c77b98c765d/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210108203827-ffc7fda8c3d7/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20210226172003-ab064af71705/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb h1:XFBgcDwm7irdHTbz4Zk2h7Mh+eis4nfJEFQFYzJzuIA=
google.golang.org/genproto v0.0.0-20230913181813-007df8e322eb/go.mod h1:yZTlhN0tQnXo3h00fuXNCxJdLdIdnVFVBaRJ5LWBbw4=
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb h1:lK0oleSc7IQsUxO3U5TjL9DWlsxpEBemh+zpB7IqhWI=
google.golang.org/genproto/googleapis/api v0.0.0-20230913181813-007df8e322eb/go.mod h1:KjSP20unUpOx5kyQUFa7k4OJg0qeJ7DEZflGDu2p6Bk=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13 h1:N3bU/SQDCDyD6R528GJ/PwW9KjYcJA3dgyH+MovAkIM=
google.golang.org/genproto/googleapis/rpc v0.0.0-20230920204549-e6e6cdab5c13/go.mod h1:KSqppvjFjtoCI+KGd4PELB0qLNxdJHRGqRI09mB6pQA=
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
......@@ -538,8 +544,8 @@ google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15 h1:YR8cESwS4TdDjEe65xsg0ogRM/Nc3DYOhEAlW+xobZo=
gopkg.in/check.v1 v1.0.0-20190902080502-41f04d3bba15/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c/go.mod h1:JHkPIbrfpd72SG/EVd6muEfDQjcINNoR0C8j2r3qZ4Q=
gopkg.in/errgo.v2 v2.1.0/go.mod h1:hNsd1EY+bozCKY1Ytp96fpM3vjJbqLJn88ws8XvfDNI=
gopkg.in/ini.v1 v1.67.0 h1:Dgnx+6+nfE+IfzjUEISNeydPJh9AXNNsWbGP9KzCsOA=
gopkg.in/ini.v1 v1.67.0/go.mod h1:pNLf8WUiyNEtQjuu5G5vTm06TEv9tsIgeAvK8hOrP4k=
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment