Skip to content

2044 - merging and adding new actions #2468

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
378 changes: 378 additions & 0 deletions docs/src/content/docs/reference/components/crypto-helper.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,388 @@ Type: STRING



### PGP Decrypt
Name: pgpDecrypt

Decrypts PGP encrypted file using private key and passphrase.

#### Properties

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| privateKey | Private PGP Key | STRING | Private PGP key that will decrypt the file. Make sure there is a new line after the PGP header. | true |
| file | File | FILE_ENTRY | File that will be decrypted. | true |
| passphrase | Passphrase | STRING | Passphrase that was used for encryption. | true |

#### Example JSON Structure
```json
{
"label" : "PGP Decrypt",
"name" : "pgpDecrypt",
"parameters" : {
"privateKey" : "",
"file" : {
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
},
"passphrase" : ""
},
"type" : "cryptoHelper/v1/pgpDecrypt"
}
```

#### Output



Type: FILE_ENTRY


#### Properties

| Name | Type | Description |
|:------------:|:------------:|:-------------------:|
| extension | STRING | |
| mimeType | STRING | |
| name | STRING | |
| url | STRING | |




#### Output Example
```json
{
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
}
```


### PGP Encrypt
Name: pgpEncrypt

Encrypts the file using PGP public key.

#### Properties

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| publicKey | Public PGP Key | STRING | Public PGP key of the recipient of the encrypted file. Make sure there is a new line after the PGP header. | true |
| file | File | FILE_ENTRY | File that will be encrypted. | true |

#### Example JSON Structure
```json
{
"label" : "PGP Encrypt",
"name" : "pgpEncrypt",
"parameters" : {
"publicKey" : "",
"file" : {
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
}
},
"type" : "cryptoHelper/v1/pgpEncrypt"
}
```

#### Output



Type: FILE_ENTRY


#### Properties

| Name | Type | Description |
|:------------:|:------------:|:-------------------:|
| extension | STRING | |
| mimeType | STRING | |
| name | STRING | |
| url | STRING | |




#### Output Example
```json
{
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
}
```


### RSA Decrypt
Name: rsaDecrypt

Decrypts RSA encrypted file using RSA private key.

#### Properties

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| privateKey | Private RSA Key | STRING | Private RSA key that will decrypt the file. | true |
| file | File | FILE_ENTRY | File that will be decrypted. | true |

#### Example JSON Structure
```json
{
"label" : "RSA Decrypt",
"name" : "rsaDecrypt",
"parameters" : {
"privateKey" : "",
"file" : {
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
}
},
"type" : "cryptoHelper/v1/rsaDecrypt"
}
```

#### Output



Type: FILE_ENTRY


#### Properties

| Name | Type | Description |
|:------------:|:------------:|:-------------------:|
| extension | STRING | |
| mimeType | STRING | |
| name | STRING | |
| url | STRING | |




#### Output Example
```json
{
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
}
```


### RSA Encrypt
Name: rsaEncrypt

Encrypts the file using the RSA public key.

#### Properties

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| publicKey | Public RSA Key | STRING | Public RSA key of the recipient of the encrypted file. | true |
| file | File | FILE_ENTRY | File that will be encrypted. | true |

#### Example JSON Structure
```json
{
"label" : "RSA Encrypt",
"name" : "rsaEncrypt",
"parameters" : {
"publicKey" : "",
"file" : {
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
}
},
"type" : "cryptoHelper/v1/rsaEncrypt"
}
```

#### Output



Type: FILE_ENTRY


#### Properties

| Name | Type | Description |
|:------------:|:------------:|:-------------------:|
| extension | STRING | |
| mimeType | STRING | |
| name | STRING | |
| url | STRING | |




#### Output Example
```json
{
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
}
```


### Sign
Name: sign

Cryptographically signs a file.

#### Properties

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| privateKey | Private RSA Key | STRING | Private RSA key that will be used to sign the file. | true |
| file | File | FILE_ENTRY | File that will be signed | true |

#### Example JSON Structure
```json
{
"label" : "Sign",
"name" : "sign",
"parameters" : {
"privateKey" : "",
"file" : {
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
}
},
"type" : "cryptoHelper/v1/sign"
}
```

#### Output



Type: FILE_ENTRY


#### Properties

| Name | Type | Description |
|:------------:|:------------:|:-------------------:|
| extension | STRING | |
| mimeType | STRING | |
| name | STRING | |
| url | STRING | |




#### Output Example
```json
{
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
}
```


### Verify
Name: verify

Verify the signature using public RSA key.

#### Properties

| Name | Label | Type | Description | Required |
|:---------------:|:--------------:|:------------:|:-------------------:|:--------:|
| publicKey | Public RSA Key | STRING | Public RSA key that will verify the signature. | true |
| file | File | FILE_ENTRY | File whose signature will be verified. | true |
| signature | Signature | FILE_ENTRY | Signature that will be verified. | true |

#### Example JSON Structure
```json
{
"label" : "Verify",
"name" : "verify",
"parameters" : {
"publicKey" : "",
"file" : {
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
},
"signature" : {
"extension" : "",
"mimeType" : "",
"name" : "",
"url" : ""
}
},
"type" : "cryptoHelper/v1/verify"
}
```

#### Output



Type: BOOLEAN










<hr />

# Additional instructions
<hr />

How to generate RSA key pair:

1. Run this command in terminal to create private_key.pem in the working directory:
openssl genpkey -algorithm RSA -out private_key.pem -pkeyopt rsa_keygen_bits:2048

2. Run this command in terminal to extract public key form the private key:
openssl rsa -pubout -in private_key.pem -out public_key.pem

3. To read the keys run this in terminal:
cat public_key.pem or cat private_key.pem

How to generate PGP key pair:

Run these commands in terminal.

1. sudo apt install gnupg

2. gpg --full-generate-key

3. When prompted write your name, email address, comment and passphrase

4. To get public key run:
gpg --armor --export <our_email_address> > public_key.asc

5. To get private key run:
gpg --armor --export-secret-key <our_email_address> > private_key.asc
Loading