@virtru/sdk-cli
v0.2.1
Published
Virtru SDK CLI
Downloads
1
Readme
virtru-sdk-cli
The Virtru CLI library drives the CLI tool
Usage
I/O
Input supports piping data as well as file specification. This will be detected automatically depending on the input type that is sent to the command.
echo "Hello World" | virtru-sdk encrypt
# or
virtru-sdk encrypt plaintext.txt
Output supports standard out as well as specifying a output file.
virtru-sdk encrypt # will write to std out
....
# or
virtru-sdk encrypt --out out.tdf # will write to out.tdf
Authentication
Authentication:
--auth Authentication string [string]
Authentication by AppId:
--user, -u UserId for AppId authentication [string]
--id, -i AppId for AppId authentication [string]
Authentication by HMAC:
--token, -t Token for HMAC authentication [string]
--secret, -s Secret for HMAC authentication [string]
--email, -e Email of user accessing policy [string]
Encrypt
virtru-sdk encrypt [file]
Encrypt Options
--out-html Output as TDF HTML (file size limit exists) [boolean]
Policy Options
--expiration-deadline Set policy expiration deadline (i.e., 2020-01-01,
2020-01-01T01:01, or 2020-01-01T01:01:01.000Z[string]
--owner Set the policy owner [string]
--persistent-protection Enable persistent protection (requires Secure Reader
to decrypt) [boolean] [default: false]
--users-with-access Add users to the policy [string] [default: false]
--watermarking Enable watermarking (requires Secure Reader to
decrypt) [boolean] [default: false]
### Examples
# output to stdOut
> virtru-sdk encrypt --auth $AUTH secrets.txt
[ENCRYPTED DATA]
# output to stdOut as html format
> virtru-sdk encrypt --auth $AUTH secrets.txt --out-html
<html>
...
# output to file
> virtru-sdk decrypt --auth $AUTH secrets.txt > plain.tdf
# pipe to another command
> virtru-sdk decrypt --auth $AUTH .txt | aws s3 cp - s3://some-bucket/secrets.tdf
Decrypt
virtru-sdk decrypt [file]
Decrypt TDF to string
### Examples
# output to stdOut
> virtru-sdk decrypt --auth $AUTH secrets.tdf
Shhhh!
# output to file
> virtru-sdk decrypt --auth $AUTH secrets.tdf > plain.txt
# pipe to another command
> virtru-sdk decrypt --auth $AUTH secrets.tdf | grep !
!
Policy
The policy command is a collection of commands
Fetch
virtru-sdk policy fetch [file|policy-id]
Fetch policy by TDF or policy id
### Examples
# Pass an encrypted file
> virtru-sdk policy fetch --auth $AUTH secrets.tdf
Property | Value
---------------------------------------------------------------------------
Owner | 6c180b65-xxx-xxxx-xxx-9ea57aae348a
Owner |
Users w/ Access | [email protected]
Expiration Deadline |
|
= Authorizations =================== | ====================================
Can Copy | true
Can Persistent Protection | false
Can Prevent Download | false
Can Print | true
Can Reshare | true
Can Watermarking | false
# Pass a policy id
> virtru-sdk policy fetch --auth $AUTH 6c180b65-xxx-xxxx-xxx-9ea57aae348a
...
Update
TBD