From 32984d8fc3dbb90a3fafb69fece0134f1ea790f9 Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Wed, 1 Oct 2014 15:56:26 +0300 Subject: 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. --- doc/src/sgml/pgcrypto.sgml | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'doc/src') diff --git a/doc/src/sgml/pgcrypto.sgml b/doc/src/sgml/pgcrypto.sgml index 544a1f8346a..f0928f80fe2 100644 --- a/doc/src/sgml/pgcrypto.sgml +++ b/doc/src/sgml/pgcrypto.sgml @@ -691,13 +691,39 @@ pgp_key_id(bytea) returns text -armor(data bytea) returns text +armor(data bytea [ , keys text[], values text[] ]) returns text dearmor(data text) returns bytea These functions wrap/unwrap binary data into PGP ASCII-armor format, which is basically Base64 with CRC and additional formatting. + + + If the keys and values arrays are specified, + an 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. + + + + + <function>pgp_armor_headers</function> + + + pgp_armor_headers + + + +pgp_armor_headers(data text, key out text, value out text) returns setof record + + + pgp_armor_headers() extracts the armor headers from + 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. + -- cgit v1.2.3