-
-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
261 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
## BE_CreateKeyPair | ||
|
||
BE_CreateKeyPair | ||
|
||
**Description** | ||
|
||
Generates an RSA Private Key in text format as : | ||
|
||
-----BEGIN RSA PRIVATE KEY----- | ||
MIIJKQIBAAKCAgEAsbUeQ/7WK0Dltk4Ko/MAkAyowbHL7OkCRIBLjdd54nJIwFbF | ||
... | ||
WzdSYrUaE5Dnwdf8V0GjBKg6HsiFzgDXW2sEKd/Y8zQ91Pqnhh914bLczCf7 | ||
-----END RSA PRIVATE KEY----- | ||
|
||
**Parameters** | ||
|
||
NA | ||
|
||
**Keywords** | ||
|
||
RSA PrivateKey PublicKey | ||
|
||
**Version History** | ||
|
||
* 5.0.0 : First Release | ||
|
||
**Notes** | ||
|
||
You can extract the public key from Private Keys using BE_GetPublicKey. | ||
|
||
**Compatibility** | ||
|
||
| Platform | Compatibility | | ||
|-----------|-----------| | ||
| Status | Active | | ||
| Mac FMP | Yes | | ||
| Win FMP | Yes | | ||
| FMS | Yes | | ||
| iOS | Yes | | ||
| Linux | Yes | | ||
|
||
**Example Code** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
## BE_CurlGetInfo | ||
|
||
BE_CurlGetInfo ( getInfoOption ) | ||
|
||
**Description** | ||
|
||
This function returns a value for the most recent curl operation ( HTTP, FTP, SMTP ) using the list of options that are supported by the BE_CurlSetOption function, and documented here : | ||
|
||
https://curl.se/libcurl/c/curl_easy_getinfo.html | ||
|
||
**Parameters** | ||
|
||
* *getInfoOption* : Any of the values as a text string that are documented as working in the BE_CurlSetOption function. | ||
|
||
**Keywords** | ||
|
||
curl option get set http ftp sftp smtp | ||
|
||
**Version History** | ||
|
||
* 5.0.0 : First Release | ||
|
||
**Notes** | ||
|
||
Not all options are supported in the plugin vs what is on the curl website, but the website documents them well to understand their usage. | ||
|
||
**Compatibility** | ||
|
||
| Platform | Compatibility | | ||
|-----------|-----------| | ||
| Status | Active | | ||
| Mac FMP | Yes | | ||
| Win FMP | Yes | | ||
| FMS | Yes | | ||
| iOS | Yes | | ||
| Linux | Yes | | ||
|
||
**Example Code** | ||
|
||
BE_CurlSetOption ( "CURLOPT_CERTINFO" ; 1 ) & | ||
BE_HTTP_GET ( "https://goya.com.au" ) & | ||
BE_CurlGetInfo ( "CURLINFO_CERTINFO" ) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
## BE_DecryptWithKey | ||
|
||
BE_DecryptWithKey ( encryptedText ; keyText ) | ||
|
||
**Description** | ||
|
||
Decrypts some text that was previously encrypted using the public RSA version of this key. | ||
|
||
**Parameters** | ||
|
||
* *encryptedText* : the encrypted text as base64. | ||
* *keyText* : the key in RSA PRIVATE KEY format as text. | ||
|
||
**Keywords** | ||
|
||
encrypt decrypt rsa publicKey privateKey base64 | ||
|
||
**Version History** | ||
|
||
* 5.0.0 : First Release | ||
|
||
**Notes** | ||
|
||
Uses the same logic as openssl on the command line so should be compatible with that. These keys can be used as access keys for SSH or converted to other formats. | ||
|
||
If you have issues with the keys, check the line endings. The DataViewer can mangle line endings in copy and pasted text, and line breaks in keys need to be Char ( 10 ). | ||
|
||
**Compatibility** | ||
|
||
| Platform | Compatibility | | ||
|-----------|-----------| | ||
| Status | Active | | ||
| Mac FMP | Yes | | ||
| Win FMP | Yes | | ||
| FMS | Yes | | ||
| iOS | Yes | | ||
| Linux | Yes | | ||
|
||
**Example Code** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
## BE_EncryptWithKey | ||
|
||
BE_EncryptWithKey ( text ; keyText ) | ||
|
||
**Description** | ||
|
||
Encrypts the **text** with they **keyText** supplied. | ||
|
||
**Parameters** | ||
|
||
* *text* : description. | ||
* *keyText* : description. | ||
|
||
**Keywords** | ||
|
||
encrypt decrypt rsa publicKey privateKey | ||
|
||
**Version History** | ||
|
||
* 1.0.0 : First Release | ||
|
||
**Notes** | ||
|
||
If you have issues with the keys, check the line endings. The DataViewer can mangle line endings in copy and pasted text, and line breaks in keys need to be Char ( 10 ). | ||
|
||
**Compatibility** | ||
|
||
| Platform | Compatibility | | ||
|-----------|-----------| | ||
| Status | Active | | ||
| Mac FMP | Yes | | ||
| Win FMP | Yes | | ||
| FMS | Yes | | ||
| iOS | Yes | | ||
| Linux | Yes | | ||
|
||
**Example Code** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
## BE_GetPublicKey | ||
|
||
BE_GetPublicKey ( privateKey ) | ||
|
||
**Description** | ||
|
||
Generates the public key from a given **privateKey** generated with the BE_CreateKeyPair function. | ||
|
||
**Parameters** | ||
|
||
* *privateKey* : the RSA Private Key in text format. | ||
|
||
**Keywords** | ||
|
||
RSA PrivateKey PublicKey | ||
|
||
**Version History** | ||
|
||
* 5.0.0 : First Release | ||
|
||
**Notes** | ||
|
||
If you have issues with the keys, check the line endings. The DataViewer can mangle line endings in copy and pasted text, and line breaks in keys need to be Char ( 10 ). | ||
|
||
**Compatibility** | ||
|
||
| Platform | Compatibility | | ||
|-----------|-----------| | ||
| Status | Active | | ||
| Mac FMP | Yes | | ||
| Win FMP | Yes | | ||
| FMS | Yes | | ||
| iOS | Yes | | ||
| Linux | Yes | | ||
|
||
**Example Code** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
## BE_JSON_jq | ||
|
||
BE_JSON_jq ( json ; filter { ; options } ) | ||
|
||
**Description** | ||
|
||
jq is a lightweight and flexible command-line JSON processor akin to sed,awk,grep, and friends for JSON data. It allows you to easily slice, filter, map, and transform structured data. | ||
|
||
**Parameters** | ||
|
||
* *json* : the input to the jq function. | ||
* *filter* : the filter(s) to run on the input. | ||
* *options* : one or more of the following characters : V c j r - see notes. | ||
|
||
**Keywords** | ||
|
||
jq json | ||
|
||
**Version History** | ||
|
||
* 5.0.0 : First Release | ||
|
||
**Notes** | ||
|
||
More info is here : https://jqlang.github.io/jq/ | ||
|
||
And a manual with all the details is here : https://jqlang.github.io/jq/manual/ | ||
|
||
For testing your filters use : https://jqplay.org | ||
|
||
The option values are : | ||
|
||
c - compact - By default, jq pretty-prints JSON output. Using this option will result in more compact output by instead putting each JSON object on a single line. | ||
|
||
r - raw output ( ie not quoted text strings ) - With this option, if the filter's result is a string then it will be written directly to standard output rather than being formatted as a JSON string with quotes. This can be useful for making jq filters talk to non-JSON-based systems. | ||
|
||
j - join output : Like -r but jq won't print a newline after each output. | ||
|
||
V - version info. | ||
|
||
**Compatibility** | ||
|
||
| Platform | Compatibility | | ||
|-----------|-----------| | ||
| Status | Active | | ||
| Mac FMP | Yes | | ||
| Win FMP | No | | ||
| FMS | Yes | | ||
| iOS | Yes | | ||
| Linux | Yes | | ||
|
||
**Example Code** | ||
|
||
Get all the names of product types : | ||
|
||
BE_JSON_jq ( $json ; ".productTypes[].name" ) | ||
|
||
In an array of prices select the ones where quantity is 1, then sort by price, and find the largest, and return that price : | ||
|
||
BE_JSON_jq ( $json ; "[ .prices[] | select(.quantity == 1 ) ] | max_by(.price) | .price" ; "r" ) | ||
|
||
Find all possible values of a node, deep in a json object : | ||
|
||
BE_JSON_jq ( $json ; “.data.products.edges[].node.category.name” ; “r” ) |