grpcapi

package
v0.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 23, 2022 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Status_name = map[int32]string{
		0: "OK",
		1: "FAIL",
		2: "NOT_IMPLEMENTED",
	}
	Status_value = map[string]int32{
		"OK":              0,
		"FAIL":            1,
		"NOT_IMPLEMENTED": 2,
	}
)

Enum value maps for Status.

View Source
var (
	HashFunction_name = map[int32]string{
		0:  "SHA1",
		1:  "SHA224",
		2:  "SHA256",
		3:  "SHA384",
		4:  "SHA512",
		5:  "MD4",
		6:  "MD5",
		7:  "MD5SHA1",
		8:  "RIPEMD160",
		9:  "SHA3_224",
		10: "SHA3_256",
		11: "SHA3_384",
		12: "SHA3_512",
		13: "SHA512_224",
		14: "SHA512_256",
		15: "BLAKE2s_256",
		16: "BLAKE2b_256",
		17: "BLAKE2b_384",
		18: "BLAKE2b_512",
	}
	HashFunction_value = map[string]int32{
		"SHA1":        0,
		"SHA224":      1,
		"SHA256":      2,
		"SHA384":      3,
		"SHA512":      4,
		"MD4":         5,
		"MD5":         6,
		"MD5SHA1":     7,
		"RIPEMD160":   8,
		"SHA3_224":    9,
		"SHA3_256":    10,
		"SHA3_384":    11,
		"SHA3_512":    12,
		"SHA512_224":  13,
		"SHA512_256":  14,
		"BLAKE2s_256": 15,
		"BLAKE2b_256": 16,
		"BLAKE2b_384": 17,
		"BLAKE2b_512": 18,
	}
)

Enum value maps for HashFunction.

View Source
var CMCService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "grpcapi.CMCService",
	HandlerType: (*CMCServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "TLSSign",
			Handler:    _CMCService_TLSSign_Handler,
		},
		{
			MethodName: "TLSCert",
			Handler:    _CMCService_TLSCert_Handler,
		},
		{
			MethodName: "Attest",
			Handler:    _CMCService_Attest_Handler,
		},
		{
			MethodName: "Verify",
			Handler:    _CMCService_Verify_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "grpcapi.proto",
}

CMCService_ServiceDesc is the grpc.ServiceDesc for CMCService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_grpcapi_proto protoreflect.FileDescriptor

Functions

func RegisterCMCServiceServer

func RegisterCMCServiceServer(s grpc.ServiceRegistrar, srv CMCServiceServer)

Types

type AttestationRequest

type AttestationRequest struct {
	Id    string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Nonce []byte `protobuf:"bytes,2,opt,name=nonce,proto3" json:"nonce,omitempty"`
	// contains filtered or unexported fields
}

func (*AttestationRequest) Descriptor deprecated

func (*AttestationRequest) Descriptor() ([]byte, []int)

Deprecated: Use AttestationRequest.ProtoReflect.Descriptor instead.

func (*AttestationRequest) GetId

func (x *AttestationRequest) GetId() string

func (*AttestationRequest) GetNonce

func (x *AttestationRequest) GetNonce() []byte

func (*AttestationRequest) ProtoMessage

func (*AttestationRequest) ProtoMessage()

func (*AttestationRequest) ProtoReflect

func (x *AttestationRequest) ProtoReflect() protoreflect.Message

func (*AttestationRequest) Reset

func (x *AttestationRequest) Reset()

func (*AttestationRequest) String

func (x *AttestationRequest) String() string

type AttestationResponse

type AttestationResponse struct {
	Status            Status `protobuf:"varint,1,opt,name=status,proto3,enum=grpcapi.Status" json:"status,omitempty"`
	AttestationReport []byte `protobuf:"bytes,2,opt,name=attestation_report,json=attestationReport,proto3" json:"attestation_report,omitempty"`
	// contains filtered or unexported fields
}

func (*AttestationResponse) Descriptor deprecated

func (*AttestationResponse) Descriptor() ([]byte, []int)

Deprecated: Use AttestationResponse.ProtoReflect.Descriptor instead.

func (*AttestationResponse) GetAttestationReport

func (x *AttestationResponse) GetAttestationReport() []byte

func (*AttestationResponse) GetStatus

func (x *AttestationResponse) GetStatus() Status

func (*AttestationResponse) ProtoMessage

func (*AttestationResponse) ProtoMessage()

func (*AttestationResponse) ProtoReflect

func (x *AttestationResponse) ProtoReflect() protoreflect.Message

func (*AttestationResponse) Reset

func (x *AttestationResponse) Reset()

func (*AttestationResponse) String

func (x *AttestationResponse) String() string

type CMCServiceClient

type CMCServiceClient interface {
	// Signs content of request with key that belongs to ID of requester
	TLSSign(ctx context.Context, in *TLSSignRequest, opts ...grpc.CallOption) (*TLSSignResponse, error)
	TLSCert(ctx context.Context, in *TLSCertRequest, opts ...grpc.CallOption) (*TLSCertResponse, error)
	Attest(ctx context.Context, in *AttestationRequest, opts ...grpc.CallOption) (*AttestationResponse, error)
	Verify(ctx context.Context, in *VerificationRequest, opts ...grpc.CallOption) (*VerificationResponse, error)
}

CMCServiceClient is the client API for CMCService 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.

func NewCMCServiceClient

func NewCMCServiceClient(cc grpc.ClientConnInterface) CMCServiceClient

type CMCServiceServer

type CMCServiceServer interface {
	// Signs content of request with key that belongs to ID of requester
	TLSSign(context.Context, *TLSSignRequest) (*TLSSignResponse, error)
	TLSCert(context.Context, *TLSCertRequest) (*TLSCertResponse, error)
	Attest(context.Context, *AttestationRequest) (*AttestationResponse, error)
	Verify(context.Context, *VerificationRequest) (*VerificationResponse, error)
	// contains filtered or unexported methods
}

CMCServiceServer is the server API for CMCService service. All implementations must embed UnimplementedCMCServiceServer for forward compatibility

type HashFunction

type HashFunction int32
const (
	HashFunction_SHA1        HashFunction = 0
	HashFunction_SHA224      HashFunction = 1
	HashFunction_SHA256      HashFunction = 2
	HashFunction_SHA384      HashFunction = 3
	HashFunction_SHA512      HashFunction = 4
	HashFunction_MD4         HashFunction = 5
	HashFunction_MD5         HashFunction = 6
	HashFunction_MD5SHA1     HashFunction = 7
	HashFunction_RIPEMD160   HashFunction = 8
	HashFunction_SHA3_224    HashFunction = 9
	HashFunction_SHA3_256    HashFunction = 10
	HashFunction_SHA3_384    HashFunction = 11
	HashFunction_SHA3_512    HashFunction = 12
	HashFunction_SHA512_224  HashFunction = 13
	HashFunction_SHA512_256  HashFunction = 14
	HashFunction_BLAKE2s_256 HashFunction = 15
	HashFunction_BLAKE2b_256 HashFunction = 16
	HashFunction_BLAKE2b_384 HashFunction = 17
	HashFunction_BLAKE2b_512 HashFunction = 18
)

func (HashFunction) Descriptor

func (HashFunction) Enum

func (x HashFunction) Enum() *HashFunction

func (HashFunction) EnumDescriptor deprecated

func (HashFunction) EnumDescriptor() ([]byte, []int)

Deprecated: Use HashFunction.Descriptor instead.

func (HashFunction) Number

func (HashFunction) String

func (x HashFunction) String() string

func (HashFunction) Type

type PSSOptions

type PSSOptions struct {
	SaltLength int32 `protobuf:"varint,1,opt,name=salt_length,json=saltLength,proto3" json:"salt_length,omitempty"`
	// contains filtered or unexported fields
}

func (*PSSOptions) Descriptor deprecated

func (*PSSOptions) Descriptor() ([]byte, []int)

Deprecated: Use PSSOptions.ProtoReflect.Descriptor instead.

func (*PSSOptions) GetSaltLength

func (x *PSSOptions) GetSaltLength() int32

func (*PSSOptions) ProtoMessage

func (*PSSOptions) ProtoMessage()

func (*PSSOptions) ProtoReflect

func (x *PSSOptions) ProtoReflect() protoreflect.Message

func (*PSSOptions) Reset

func (x *PSSOptions) Reset()

func (*PSSOptions) String

func (x *PSSOptions) String() string

type Status

type Status int32
const (
	Status_OK              Status = 0
	Status_FAIL            Status = 1
	Status_NOT_IMPLEMENTED Status = 2
)

func (Status) Descriptor

func (Status) Descriptor() protoreflect.EnumDescriptor

func (Status) Enum

func (x Status) Enum() *Status

func (Status) EnumDescriptor deprecated

func (Status) EnumDescriptor() ([]byte, []int)

Deprecated: Use Status.Descriptor instead.

func (Status) Number

func (x Status) Number() protoreflect.EnumNumber

func (Status) String

func (x Status) String() string

func (Status) Type

func (Status) Type() protoreflect.EnumType

type TLSCertRequest

type TLSCertRequest struct {
	Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	// contains filtered or unexported fields
}

func (*TLSCertRequest) Descriptor deprecated

func (*TLSCertRequest) Descriptor() ([]byte, []int)

Deprecated: Use TLSCertRequest.ProtoReflect.Descriptor instead.

func (*TLSCertRequest) GetId

func (x *TLSCertRequest) GetId() string

func (*TLSCertRequest) ProtoMessage

func (*TLSCertRequest) ProtoMessage()

func (*TLSCertRequest) ProtoReflect

func (x *TLSCertRequest) ProtoReflect() protoreflect.Message

func (*TLSCertRequest) Reset

func (x *TLSCertRequest) Reset()

func (*TLSCertRequest) String

func (x *TLSCertRequest) String() string

type TLSCertResponse

type TLSCertResponse struct {
	Status      Status   `protobuf:"varint,1,opt,name=status,proto3,enum=grpcapi.Status" json:"status,omitempty"`
	Certificate [][]byte `protobuf:"bytes,2,rep,name=certificate,proto3" json:"certificate,omitempty"` // PEM encoded, separated by line
	// contains filtered or unexported fields
}

func (*TLSCertResponse) Descriptor deprecated

func (*TLSCertResponse) Descriptor() ([]byte, []int)

Deprecated: Use TLSCertResponse.ProtoReflect.Descriptor instead.

func (*TLSCertResponse) GetCertificate

func (x *TLSCertResponse) GetCertificate() [][]byte

func (*TLSCertResponse) GetStatus

func (x *TLSCertResponse) GetStatus() Status

func (*TLSCertResponse) ProtoMessage

func (*TLSCertResponse) ProtoMessage()

func (*TLSCertResponse) ProtoReflect

func (x *TLSCertResponse) ProtoReflect() protoreflect.Message

func (*TLSCertResponse) Reset

func (x *TLSCertResponse) Reset()

func (*TLSCertResponse) String

func (x *TLSCertResponse) String() string

type TLSSignRequest

type TLSSignRequest struct {
	Id       string       `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
	Content  []byte       `protobuf:"bytes,2,opt,name=content,proto3" json:"content,omitempty"`
	Hashtype HashFunction `protobuf:"varint,3,opt,name=hashtype,proto3,enum=grpcapi.HashFunction" json:"hashtype,omitempty"`
	PssOpts  *PSSOptions  `protobuf:"bytes,4,opt,name=pssOpts,proto3" json:"pssOpts,omitempty"`
	// contains filtered or unexported fields
}

func (*TLSSignRequest) Descriptor deprecated

func (*TLSSignRequest) Descriptor() ([]byte, []int)

Deprecated: Use TLSSignRequest.ProtoReflect.Descriptor instead.

func (*TLSSignRequest) GetContent

func (x *TLSSignRequest) GetContent() []byte

func (*TLSSignRequest) GetHashtype

func (x *TLSSignRequest) GetHashtype() HashFunction

func (*TLSSignRequest) GetId

func (x *TLSSignRequest) GetId() string

func (*TLSSignRequest) GetPssOpts

func (x *TLSSignRequest) GetPssOpts() *PSSOptions

func (*TLSSignRequest) ProtoMessage

func (*TLSSignRequest) ProtoMessage()

func (*TLSSignRequest) ProtoReflect

func (x *TLSSignRequest) ProtoReflect() protoreflect.Message

func (*TLSSignRequest) Reset

func (x *TLSSignRequest) Reset()

func (*TLSSignRequest) String

func (x *TLSSignRequest) String() string

type TLSSignResponse

type TLSSignResponse struct {
	Status        Status `protobuf:"varint,1,opt,name=status,proto3,enum=grpcapi.Status" json:"status,omitempty"`
	SignedContent []byte `protobuf:"bytes,2,opt,name=signed_content,json=signedContent,proto3" json:"signed_content,omitempty"`
	// contains filtered or unexported fields
}

func (*TLSSignResponse) Descriptor deprecated

func (*TLSSignResponse) Descriptor() ([]byte, []int)

Deprecated: Use TLSSignResponse.ProtoReflect.Descriptor instead.

func (*TLSSignResponse) GetSignedContent

func (x *TLSSignResponse) GetSignedContent() []byte

func (*TLSSignResponse) GetStatus

func (x *TLSSignResponse) GetStatus() Status

func (*TLSSignResponse) ProtoMessage

func (*TLSSignResponse) ProtoMessage()

func (*TLSSignResponse) ProtoReflect

func (x *TLSSignResponse) ProtoReflect() protoreflect.Message

func (*TLSSignResponse) Reset

func (x *TLSSignResponse) Reset()

func (*TLSSignResponse) String

func (x *TLSSignResponse) String() string

type UnimplementedCMCServiceServer

type UnimplementedCMCServiceServer struct {
}

UnimplementedCMCServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedCMCServiceServer) Attest

func (UnimplementedCMCServiceServer) TLSCert

func (UnimplementedCMCServiceServer) TLSSign

func (UnimplementedCMCServiceServer) Verify

type UnsafeCMCServiceServer

type UnsafeCMCServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeCMCServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CMCServiceServer will result in compilation errors.

type VerificationRequest

type VerificationRequest struct {
	Nonce             []byte `protobuf:"bytes,1,opt,name=nonce,proto3" json:"nonce,omitempty"`
	AttestationReport []byte `protobuf:"bytes,2,opt,name=attestation_report,json=attestationReport,proto3" json:"attestation_report,omitempty"`
	Ca                []byte `protobuf:"bytes,3,opt,name=ca,proto3" json:"ca,omitempty"`
	Policies          []byte `protobuf:"bytes,4,opt,name=policies,proto3" json:"policies,omitempty"`
	// contains filtered or unexported fields
}

func (*VerificationRequest) Descriptor deprecated

func (*VerificationRequest) Descriptor() ([]byte, []int)

Deprecated: Use VerificationRequest.ProtoReflect.Descriptor instead.

func (*VerificationRequest) GetAttestationReport

func (x *VerificationRequest) GetAttestationReport() []byte

func (*VerificationRequest) GetCa

func (x *VerificationRequest) GetCa() []byte

func (*VerificationRequest) GetNonce

func (x *VerificationRequest) GetNonce() []byte

func (*VerificationRequest) GetPolicies

func (x *VerificationRequest) GetPolicies() []byte

func (*VerificationRequest) ProtoMessage

func (*VerificationRequest) ProtoMessage()

func (*VerificationRequest) ProtoReflect

func (x *VerificationRequest) ProtoReflect() protoreflect.Message

func (*VerificationRequest) Reset

func (x *VerificationRequest) Reset()

func (*VerificationRequest) String

func (x *VerificationRequest) String() string

type VerificationResponse

type VerificationResponse struct {
	Status             Status `protobuf:"varint,1,opt,name=status,proto3,enum=grpcapi.Status" json:"status,omitempty"`
	VerificationResult []byte `protobuf:"bytes,2,opt,name=verification_result,json=verificationResult,proto3" json:"verification_result,omitempty"`
	// contains filtered or unexported fields
}

func (*VerificationResponse) Descriptor deprecated

func (*VerificationResponse) Descriptor() ([]byte, []int)

Deprecated: Use VerificationResponse.ProtoReflect.Descriptor instead.

func (*VerificationResponse) GetStatus

func (x *VerificationResponse) GetStatus() Status

func (*VerificationResponse) GetVerificationResult

func (x *VerificationResponse) GetVerificationResult() []byte

func (*VerificationResponse) ProtoMessage

func (*VerificationResponse) ProtoMessage()

func (*VerificationResponse) ProtoReflect

func (x *VerificationResponse) ProtoReflect() protoreflect.Message

func (*VerificationResponse) Reset

func (x *VerificationResponse) Reset()

func (*VerificationResponse) String

func (x *VerificationResponse) String() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL