# rpacket - a low-level OpenPGP packet handling and inspection tool

`rpacket` is a special purpose tool for low-level operations on OpenPGP packets.

It currently supports two operations: `split` and `dump`. Both commands accept both armored and binary OpenPGP data.

## rpacket split

This operation take OpenPGP data and produces a set of files, one per OpenPGP packet.

For example, we can get Linus Torvald's certificate and split it, like this:

```
$ wget "http://pgpkeys.eu/pks/lookup?op=get&search=0xabaf11c65a2970b130abe3c479be3e4300411886" -O torvalds.cert
[..]
$ rpacket split torvalds.cert
```

As a result, a set of files is produced from the original file `torvalds.cert`, like this:

```
$ ls -l
-rw-r--r--. 1 user user 144763 Apr 10 19:51 torvalds.cert
-rw-r--r--. 1 user user    272 Apr 10 19:52 torvalds.cert-000-PublicKey
-rw-r--r--. 1 user user    638 Apr 10 19:52 torvalds.cert-001-Signature
-rw-r--r--. 1 user user    638 Apr 10 19:52 torvalds.cert-002-Signature
-rw-r--r--. 1 user user    639 Apr 10 19:52 torvalds.cert-003-Signature
-rw-r--r--. 1 user user    639 Apr 10 19:52 torvalds.cert-004-Signature
-rw-r--r--. 1 user user     38 Apr 10 19:52 torvalds.cert-005-UserId
-rw-r--r--. 1 user user    337 Apr 10 19:52 torvalds.cert-006-Signature
-rw-r--r--. 1 user user    123 Apr 10 19:52 torvalds.cert-007-Signature
-rw-r--r--. 1 user user    543 Apr 10 19:52 torvalds.cert-008-Signature
-rw-r--r--. 1 user user    570 Apr 10 19:52 torvalds.cert-009-Signature
-rw-r--r--. 1 user user     96 Apr 10 19:52 torvalds.cert-010-Signature
[..]
```

## rpacket dump

This command prints a textual representation of the information in OpenPGP data.

For example, we can use it to inspect the first packet of the split set we produced above:

```
$ rpacket dump torvalds.cert-000-PublicKey
PublicKey(
    PublicKey {
        packet_version: New,
        version: V4,
        algorithm: RSA,
        created_at: 2011-09-20T21:41:38Z,
        expiration: None,
        public_params: PublicParams::RSA {
            n: Mpi( ),
            e: Mpi(010001),
        },
    },
)
```
