

SignaturePacketBody nonHashedSubPackets, highBits16, encryptedData] Join[fingerprint, hashedUserID, hashedSignatureData, (* initialize the bit vector with 0xb704ce *) The purpose is to show the extent of what is involved.ĬrcBV = CreateDataStructure

I cannot guarantee the accuracy of the code. RFC 2440 can be quite confusing, particularly concerning the signature and the fields to hash and encrypt. The Base64 data will include 3 types of packets: Public Key, User ID, Signature. UPDATE: Partial implementation of RFC 2440 to generate a Public Key ASCII armor block from GenerateAsymmetricKeyPair. But how can I actually get Mathematica to produce key blocks in this standard format? I realise that since the base64 string in the public key block contains other information as well as the public key in the strict sense - and similarly for the private key block, which in fact contains the public key as well as the private key in the strict sense - some information (including name, email address, and passphrase if specified) may need to be processed by Mathematica before GenerateAsymmetricKeyPair is called, and if not before then it certainly will after. This is the standard format if you want to send someone your public key in the body text of an email, for example.Ī private key block looks similar: -BEGIN PGP PRIVATE KEY BLOCK. broken into 64-character lines in base64, like this: -BEGIN PGP PUBLIC KEY BLOCK.

Having generated a PGP key pair using GenerateAsymmetricKeyPair, how can I print the two key blocks in the format in which they are usually stated, i.e. This question is related to, but not the same as, two others I recently asked about using Mathematica's PGP functionality: " After using GenerateAsymmetricKeyPair, how to print the two keys in hex?" and " Given a PGP public key, how can I extract its PGP fingerprint in hex, using v12.0?".
