Create RSA Cipher

Verb: cipherRsa

Available from: <Standard>

Creates an RSA cipher in Encrypt or Decrypt mode, along with the format for key loading .

Syntax

cipherRsa --rsamode(RsaMode) --rsakeyformat(RsaKeyFormat) [--privatekey(String)] [--publickey(String)] [--password(String)] --search(String) --findtype(Nullable<X509FindType>) --storename(Nullable<StoreName>) --storelocation(Nullable<StoreLocation>) [--oaeppadding(Boolean)] (Boolean)=success (Cipher)=value

Inputs

Script Designer Required AcceptedTypes Description
--rsamode RSA Mode Required RsaMode Options for selecting the mode used:
  • Decrypt
  • Encrypt
  • --rsakeyformat Key format Required RsaKeyFormat Options for selecting the format used for key loading:
  • Base64
  • PemFile
  • X509
  • XmlFile
  • --privatekey Private key Optional Text Private key used in encryption.
    --publickey Public key Optional Text Public key used in encryption.
    --password Password Optional Text Password used to generate the private key.
    --search Search Only whenKey format is X509 Text Value that is searched.
    --findtype Type searched Only whenKey format is X509 X509FindType Type of the value that is searched.
    --storename Repository name Only whenKey format is X509 StoreName Name of the X509 repository used.
    --storelocation Repository location Only whenKey format is X509 StoreLocation Location of the X509 repository used in the search.
    --oaeppadding OAEP padding Optional Boolean Option that defines whether OAEP should be used.

    Outputs

    Script Designer AcceptedTypes Description
    success Success Boolean True if the encryption is created correctly or False if it is not.
    value Cipher Cipher Variable containing RSA encryption created.

    Example

    Example 1: Creates an RSA-type encryption in Encrypt mode, having a public key informed by a .pem file. After execution, it is informed whether the encryption was created successfully.

    defVar --name success --type Boolean
    defVar --name rsaEncryption --type Cipher
    // Create an RSA encryption in "Encrypt" mode, and enter a .pem file for the public key.
    // Download the following file to execute the command.
    cipherRsa --rsamode "Encrypt" --rsakeyformat "PemFile" --publickey "public.pem" --oaeppadding  success=success rsaEncryption=value
    logMessage --message "${success}" --type "Info"
    // Execution returns the success of creation.
    

    Download File


    For the correct operation of the script above, it is necessary to download the file and enter its path in the Private key parameter of the Create RSA Cipher command.

    Example 2: Creates an RSA-type encryption in Decrypt mode, having a private key informed by a .pem file. After execution, it is informed whether the encryption was created successfully.

    defVar --name success --type Boolean
    defVar --name rsaEncryption --type Cipher
    // Create an RSA encryption in "Decrypt" mode, and enter a .pem file for the private key.
    // Download the following file to execute the command.
    cipherRsa --rsamode "Decrypt" --rsakeyformat "PemFile" --privatekey "public.pem" --oaeppadding  success=success rsaEncryption=value
    logMessage --message "${success}" --type "Info"
    // Execution returns the success of creation.
    

    Download File


    For the correct operation of the script above, it is necessary to download the file and enter its path in the Private key parameter of the Create RSA Cipher command.

    See Also

  • Create AES Encryption
  • Create Rijndael Cipher
  • Decrypt
  • Encrypt