singpolyma / openpgp-php

OpenPGP.php is a pure-PHP implementation of the OpenPGP Message Format (RFC 4880).
http://singpolyma.github.io/openpgp-php/
The Unlicense
179 stars 69 forks source link

OpenPGP_PublicSubkeyPacket in SubKey exemple? #131

Closed puggan closed 3 weeks ago

puggan commented 1 year ago

In the subkey exemple: https://github.com/singpolyma/openpgp-php/blob/1c3bdcd2d9c6113c2d6b768e208e7432a48d3a1e/examples/keygenSubkeys.php#L61

Guess this should be OpenPGP_PublicSubkeyPacket ?

(If I was more sure I would do a PR, but just started playing around whit this library today)

jstanden commented 1 month ago

The keygen example creates a private (secret) key with a separate sub-key for encryption. The referenced line with the modulus, exponents, and primes is definitely a secret key.

The public key is derived from the secret key at the end of the example.