[crypto.rsa.encrypt]

crypto.rsa.encrypt is a slot in the crypto namespace, in Hyperlambda, the language of Magic Cloud. Encrypts data using RSA.

  • Value (text,binary-content), required: Content to encrypt
  • Returns: Resolves to the encrypted package as base64 text or raw bytes when [raw] is true

Arguments

Required arguments come first, then the optional ones in the order they are declared.

Argument Type Required Description
[public-key] string|byte[] yes Public key for the RSA operation.
[raw] bool no Whether to return raw bytes instead of encoded text. Default: false.

JSON declaration

This is the complete declaration of crypto.rsa.encrypt, as the running system describes it. It is also published as slot.json.

JSON declaration
{
  "name": "crypto.rsa.encrypt",
  "description": "Encrypts data using RSA",
  "signature": {
    "input": {
      "kind": "text,binary-content",
      "description": "Content to encrypt",
      "required": true,
      "mode": "ValueOrExpression"
    },
    "children": {
      "public-key": {
        "type": "string|byte[]",
        "kind": "rsa-public-key",
        "description": "Public key for the RSA operation",
        "required": true,
        "mode": "ValueOrExpression",
        "cardinality": "ExactlyOne",
        "role": "Option",
        "projection": "Value"
      },
      "raw": {
        "type": "bool",
        "description": "Whether to return raw bytes instead of encoded text",
        "required": false,
        "mode": "ValueOrExpression",
        "cardinality": "ZeroOrOne",
        "default": "false",
        "role": "Option",
        "projection": "Value"
      }
    },
    "output": {
      "mode": "Value",
      "kind": "rsa-encrypted-package,fingerprint-source",
      "description": "Resolves to the encrypted package as base64 text or raw bytes when [raw] is true"
    }
  }
}

← crypto.rsa.decrypt all crypto.* slots crypto.rsa.sign →