pg.ddx.io  pgsql-docs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Documentation for pgp_pub_decrypt
4+ messages / 4 participants
[nested] [flat]

* Documentation for pgp_pub_decrypt
@ 2016-09-25 09:55 joe@snikeris.com
  2016-09-26 18:19 ` Re: Documentation for pgp_pub_decrypt Kevin Grittner <kgrittn@gmail.com>
  2016-09-26 19:44 ` Re: Documentation for pgp_pub_decrypt Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 4+ messages in thread

From: joe@snikeris.com @ 2016-09-25 09:55 UTC (permalink / raw)
  To: pgsql-docs

The following documentation comment has been logged on the website:

Page: https://www.postgresql.org/docs/9.5/static/pgcrypto.html
Description:

I believe the first argument should be of type &#39;text&#39;. Especially
considering the paragraph that follows discusses how passing in bytea is
disallowed.

-- 
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs


^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Documentation for pgp_pub_decrypt
  2016-09-25 09:55 Documentation for pgp_pub_decrypt joe@snikeris.com
@ 2016-09-26 18:19 ` Kevin Grittner <kgrittn@gmail.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Kevin Grittner @ 2016-09-26 18:19 UTC (permalink / raw)
  To: joe@snikeris.com; +Cc: pgsql-docs

On Sun, Sep 25, 2016 at 4:55 AM,  <joe@snikeris.com> wrote:

> I believe the first argument [apparently of pg_sym_decrypt() and
> pg_pub_decrypt()] should be of type &#39;text&#39;. Especially
> considering the paragraph that follows discusses how passing in
> bytea is disallowed.

The *encrypted* form is bytea; those functions *return* text and
are thus not a good way to get back to unencrypted bytea data; an
additional transformation would still be required to get to the
byte format from text, and the bytes representing those character
strings would depend on the character encoding.

--
Kevin Grittner
EDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company


-- 
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Documentation for pgp_pub_decrypt
  2016-09-25 09:55 Documentation for pgp_pub_decrypt joe@snikeris.com
@ 2016-09-26 19:44 ` Tom Lane <tgl@sss.pgh.pa.us>
  2016-09-26 23:03   ` Re: Documentation for pgp_pub_decrypt Joe Snikeris <joe@snikeris.com>
  1 sibling, 1 reply; 4+ messages in thread

From: Tom Lane @ 2016-09-26 19:44 UTC (permalink / raw)
  To: joe@snikeris.com; +Cc: pgsql-docs

joe@snikeris.com writes:
> The following documentation comment has been logged on the website:
> Page: https://www.postgresql.org/docs/9.5/static/pgcrypto.html
> Description:

> I believe the first argument should be of type &#39;text&#39;. Especially
> considering the paragraph that follows discusses how passing in bytea is
> disallowed.

No, that's how the function is declared.  Maybe the following para isn't
clear enough.  What it's talking about is that the encrypted message has
to contain a marker saying it was originally text.

			regards, tom lane


-- 
Sent via pgsql-docs mailing list (pgsql-docs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Documentation for pgp_pub_decrypt
  2016-09-25 09:55 Documentation for pgp_pub_decrypt joe@snikeris.com
  2016-09-26 19:44 ` Re: Documentation for pgp_pub_decrypt Tom Lane <tgl@sss.pgh.pa.us>
@ 2016-09-26 23:03   ` Joe Snikeris <joe@snikeris.com>
  0 siblings, 0 replies; 4+ messages in thread

From: Joe Snikeris @ 2016-09-26 23:03 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-docs

Thank you. Your response helped me figure out why pgp_pub_decrypt wasn't
working for data that was encrypted outside of pgcrypto. The marker you
mention must be added by pgp_pub_encrypt? Perhaps it's worth mentioning in
the documentation that pgp_pub_decrypt is only intended be used on data
encrypted with pgp_pub_encrypt since it's unlikely that a user is going to
add that marker themselves.

On Sep 26, 2016 3:44 PM, "Tom Lane" <tgl@sss.pgh.pa.us> wrote:

> joe@snikeris.com writes:
> > The following documentation comment has been logged on the website:
> > Page: https://www.postgresql.org/docs/9.5/static/pgcrypto.html
> > Description:
>
> > I believe the first argument should be of type &#39;text&#39;. Especially
> > considering the paragraph that follows discusses how passing in bytea is
> > disallowed.
>
> No, that's how the function is declared.  Maybe the following para isn't
> clear enough.  What it's talking about is that the encrypted message has
> to contain a marker saying it was originally text.
>
>                         regards, tom lane
>

^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2016-09-26 23:03 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-09-25 09:55 Documentation for pgp_pub_decrypt joe@snikeris.com
2016-09-26 18:19 ` Kevin Grittner <kgrittn@gmail.com>
2016-09-26 19:44 ` Tom Lane <tgl@sss.pgh.pa.us>
2016-09-26 23:03   ` Joe Snikeris <joe@snikeris.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox