cryptography

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2026 License: Apache-2.0 Imports: 11 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package cryptography exposes the Dapr cryptography building block as MCP tools. It is not named crypto so it does not shadow the standard library package.

Index

Constants

View Source
const (

	// DefaultKeyName is the key encrypt_data uses when the caller names none.
	DefaultKeyName = "rsa-private-key.pem"
	// DefaultKeyWrapAlgorithm is the key wrap algorithm encrypt_data uses
	// when the caller names none.
	DefaultKeyWrapAlgorithm = "RSA"
)

Variables

This section is empty.

Functions

func RegisterTools

func RegisterTools(server *mcp.Server, client CryptoClient, metrics *telemetry.ToolMetrics)

RegisterTools registers the encrypt_data and decrypt_data tools on server. metrics may be nil.

func ToolNames added in v0.0.2

func ToolNames() []string

ToolNames returns the names of the tools RegisterTools adds.

Types

type CryptoClient

type CryptoClient interface {
	Encrypt(ctx context.Context, data io.Reader, opts dapr.EncryptOptions) (io.Reader, error)
	Decrypt(ctx context.Context, data io.Reader, opts dapr.DecryptOptions) (io.Reader, error)
}

CryptoClient defines the interface for cryptography operations.

type DecryptArgs

type DecryptArgs struct {
	ComponentName string `json:"componentName" jsonschema:"The name of the Dapr Cryptography component."`
	CipherText    string `json:"cipherText" jsonschema:"The base64-encoded cipher text returned by encrypt_data."`
	KeyName       string `` /* 148-byte string literal not displayed */
}

DecryptArgs are the arguments of the decrypt_data tool.

type EncryptArgs

type EncryptArgs struct {
	ComponentName    string `json:"componentName" jsonschema:"The name of the Dapr Cryptography component."`
	PlainText        string `json:"plainText" jsonschema:"The plain text message to be encrypted."`
	KeyName          string `` /* 131-byte string literal not displayed */
	KeyWrapAlgorithm string `` /* 133-byte string literal not displayed */
}

EncryptArgs are the arguments of the encrypt_data tool.

Jump to

Keyboard shortcuts

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