// Code generated by protoc-gen-go-grpc. DO NOT EDIT.
// versions:
// - protoc-gen-go-grpc v1.5.1
// - protoc             v3.21.12
// source: yandex/cloud/kms/v1/asymmetricencryption/asymmetric_encryption_crypto_service.proto

package kms

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.64.0 or later.
const _ = grpc.SupportPackageIsVersion9

const (
	AsymmetricEncryptionCryptoService_Decrypt_FullMethodName      = "/yandex.cloud.kms.v1.asymmetricencryption.AsymmetricEncryptionCryptoService/Decrypt"
	AsymmetricEncryptionCryptoService_GetPublicKey_FullMethodName = "/yandex.cloud.kms.v1.asymmetricencryption.AsymmetricEncryptionCryptoService/GetPublicKey"
)

// AsymmetricEncryptionCryptoServiceClient is the client API for AsymmetricEncryptionCryptoService 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.
//
// Set of methods that perform asymmetric decryption.
type AsymmetricEncryptionCryptoServiceClient interface {
	// Decrypts the given ciphertext with the specified key.
	Decrypt(ctx context.Context, in *AsymmetricDecryptRequest, opts ...grpc.CallOption) (*AsymmetricDecryptResponse, error)
	// Gets value of public key.
	GetPublicKey(ctx context.Context, in *AsymmetricGetPublicKeyRequest, opts ...grpc.CallOption) (*AsymmetricGetPublicKeyResponse, error)
}

type asymmetricEncryptionCryptoServiceClient struct {
	cc grpc.ClientConnInterface
}

func NewAsymmetricEncryptionCryptoServiceClient(cc grpc.ClientConnInterface) AsymmetricEncryptionCryptoServiceClient {
	return &asymmetricEncryptionCryptoServiceClient{cc}
}

func (c *asymmetricEncryptionCryptoServiceClient) Decrypt(ctx context.Context, in *AsymmetricDecryptRequest, opts ...grpc.CallOption) (*AsymmetricDecryptResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(AsymmetricDecryptResponse)
	err := c.cc.Invoke(ctx, AsymmetricEncryptionCryptoService_Decrypt_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

func (c *asymmetricEncryptionCryptoServiceClient) GetPublicKey(ctx context.Context, in *AsymmetricGetPublicKeyRequest, opts ...grpc.CallOption) (*AsymmetricGetPublicKeyResponse, error) {
	cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
	out := new(AsymmetricGetPublicKeyResponse)
	err := c.cc.Invoke(ctx, AsymmetricEncryptionCryptoService_GetPublicKey_FullMethodName, in, out, cOpts...)
	if err != nil {
		return nil, err
	}
	return out, nil
}

// AsymmetricEncryptionCryptoServiceServer is the server API for AsymmetricEncryptionCryptoService service.
// All implementations should embed UnimplementedAsymmetricEncryptionCryptoServiceServer
// for forward compatibility.
//
// Set of methods that perform asymmetric decryption.
type AsymmetricEncryptionCryptoServiceServer interface {
	// Decrypts the given ciphertext with the specified key.
	Decrypt(context.Context, *AsymmetricDecryptRequest) (*AsymmetricDecryptResponse, error)
	// Gets value of public key.
	GetPublicKey(context.Context, *AsymmetricGetPublicKeyRequest) (*AsymmetricGetPublicKeyResponse, error)
}

// UnimplementedAsymmetricEncryptionCryptoServiceServer should be embedded to have
// forward compatible implementations.
//
// NOTE: this should be embedded by value instead of pointer to avoid a nil
// pointer dereference when methods are called.
type UnimplementedAsymmetricEncryptionCryptoServiceServer struct{}

func (UnimplementedAsymmetricEncryptionCryptoServiceServer) Decrypt(context.Context, *AsymmetricDecryptRequest) (*AsymmetricDecryptResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method Decrypt not implemented")
}
func (UnimplementedAsymmetricEncryptionCryptoServiceServer) GetPublicKey(context.Context, *AsymmetricGetPublicKeyRequest) (*AsymmetricGetPublicKeyResponse, error) {
	return nil, status.Errorf(codes.Unimplemented, "method GetPublicKey not implemented")
}
func (UnimplementedAsymmetricEncryptionCryptoServiceServer) testEmbeddedByValue() {}

// UnsafeAsymmetricEncryptionCryptoServiceServer may be embedded to opt out of forward compatibility for this service.
// Use of this interface is not recommended, as added methods to AsymmetricEncryptionCryptoServiceServer will
// result in compilation errors.
type UnsafeAsymmetricEncryptionCryptoServiceServer interface {
	mustEmbedUnimplementedAsymmetricEncryptionCryptoServiceServer()
}

func RegisterAsymmetricEncryptionCryptoServiceServer(s grpc.ServiceRegistrar, srv AsymmetricEncryptionCryptoServiceServer) {
	// If the following call pancis, it indicates UnimplementedAsymmetricEncryptionCryptoServiceServer was
	// embedded by pointer and is nil.  This will cause panics if an
	// unimplemented method is ever invoked, so we test this at initialization
	// time to prevent it from happening at runtime later due to I/O.
	if t, ok := srv.(interface{ testEmbeddedByValue() }); ok {
		t.testEmbeddedByValue()
	}
	s.RegisterService(&AsymmetricEncryptionCryptoService_ServiceDesc, srv)
}

func _AsymmetricEncryptionCryptoService_Decrypt_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AsymmetricDecryptRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AsymmetricEncryptionCryptoServiceServer).Decrypt(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AsymmetricEncryptionCryptoService_Decrypt_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AsymmetricEncryptionCryptoServiceServer).Decrypt(ctx, req.(*AsymmetricDecryptRequest))
	}
	return interceptor(ctx, in, info, handler)
}

func _AsymmetricEncryptionCryptoService_GetPublicKey_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
	in := new(AsymmetricGetPublicKeyRequest)
	if err := dec(in); err != nil {
		return nil, err
	}
	if interceptor == nil {
		return srv.(AsymmetricEncryptionCryptoServiceServer).GetPublicKey(ctx, in)
	}
	info := &grpc.UnaryServerInfo{
		Server:     srv,
		FullMethod: AsymmetricEncryptionCryptoService_GetPublicKey_FullMethodName,
	}
	handler := func(ctx context.Context, req interface{}) (interface{}, error) {
		return srv.(AsymmetricEncryptionCryptoServiceServer).GetPublicKey(ctx, req.(*AsymmetricGetPublicKeyRequest))
	}
	return interceptor(ctx, in, info, handler)
}

// AsymmetricEncryptionCryptoService_ServiceDesc is the grpc.ServiceDesc for AsymmetricEncryptionCryptoService service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
var AsymmetricEncryptionCryptoService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "yandex.cloud.kms.v1.asymmetricencryption.AsymmetricEncryptionCryptoService",
	HandlerType: (*AsymmetricEncryptionCryptoServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "Decrypt",
			Handler:    _AsymmetricEncryptionCryptoService_Decrypt_Handler,
		},
		{
			MethodName: "GetPublicKey",
			Handler:    _AsymmetricEncryptionCryptoService_GetPublicKey_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "yandex/cloud/kms/v1/asymmetricencryption/asymmetric_encryption_crypto_service.proto",
}
