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 ¶
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.
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.