开发者

how are pgp keys formatted?

i want to write a program in python to simply read pgp keys. however, i cant seem to find any documentation describing how pgp keys are formatted. i dont want to开发者_StackOverflow中文版 be searching through the source code of open pgp to look for source code that i wont be able to understand.

say i open a public key, remove the top "-----BEGIN PGP PUBLIC KEY BLOCK-----" and bottom "-----END PGP PUBLIC KEY BLOCK-----", and change the data back into bytes, then what? i saw my name and email somewhere in the middle, but i cant see anything else. which part tells the computer the cipher name/value (say rsa = 1, elgamal = 2, etc.) in the string? where is the key size? where is the time-the-key-is-valid-for? in general, how do pkc programs read the public/private keys?


You can read the PGP RFCs (looks like the latest is RFC 4880). But why not use pyme instead?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜