1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-27 12:41:57 +03:00

Add functions for dealing with PGP armor header lines to pgcrypto.

This add a new pgp_armor_headers function to extract armor headers from an
ASCII-armored blob, and a new overloaded variant of the armor function, for
constructing an ASCII-armor with extra headers.

Marko Tiikkaja and me.
This commit is contained in:
Heikki Linnakangas
2014-10-01 15:56:26 +03:00
parent 0ef3c29a4b
commit 32984d8fc3
11 changed files with 804 additions and 7 deletions

View File

@ -691,13 +691,39 @@ pgp_key_id(bytea) returns text
</indexterm>
<synopsis>
armor(data bytea) returns text
armor(data bytea [ , keys text[], values text[] ]) returns text
dearmor(data text) returns bytea
</synopsis>
<para>
These functions wrap/unwrap binary data into PGP ASCII-armor format,
which is basically Base64 with CRC and additional formatting.
</para>
<para>
If the <parameter>keys</> and <parameter>values</> arrays are specified,
an <firstterm>armor header</> is added to the armored format for each
key/value pair. Both arrays must be single-dimensional, and they must
be of the same length. The keys and values cannot contain any non-ASCII
characters.
</para>
</sect3>
<sect3>
<title><function>pgp_armor_headers</function></title>
<indexterm>
<primary>pgp_armor_headers</primary>
</indexterm>
<synopsis>
pgp_armor_headers(data text, key out text, value out text) returns setof record
</synopsis>
<para>
<function>pgp_armor_headers()</> extracts the armor headers from
<parameter>data</>. The return value is a set of rows with two columns,
key and value. If the keys or values contain any non-ASCII characters,
they are treated as UTF-8.
</para>
</sect3>
<sect3>