docker build . -t test-c4gh
docker run --rm -ti test-c4gh
This is implemented in such a way that there's an agent that all the keys are
registered in that is then used by samtools if the file is specified as
crypt4gh:<filename>
. When launching the agent it will also automatically just
launch a subshell that you are then placed in but with a few environmental
variables set that contain the connection information to the agent. This is
similar to how the ssh-agent works except that the ssh-agent don't spawn the
subshell for you, you have to supply that as an argument to it (i.e. ssh-aget bash
or whatever). Additionally, there's no logic in the agent to detect
whether it has been launched already so adding keys to the agent will spawn a
new nested subshell, just type C-d
until the dream ends.
crypt4gh-agent -g testkey
Creates testkey.pub
and testkey.sec
crypt4gh-agent -k <keyfile> [-k <more>]
Any number of k's possible. But only the first one(s) are used for encryption.
samtools view -h <file> -o crypt4gh:<outfile>
For example in the container
samtools view -h samtools/examples/toy.sam -o crypt4gh:out.sam.crypt
crypt4gh decrypt --sk testkey.sec < out.sam.crypt
java -jar /usr/local/bin/crypt4gh.jar -sk testkey.sec -d out.sam.crypt