James Vanns wrote:

All,

When writing an RSA private key to a file as below...

RSAES_OAEP_SHA_Decryptor private_key (*rng, p_bits);
HexEncoder private_key_file (
                new FileSink p_pv_file_name.c_str ());


private_key.DEREncode (private_key_file); private_key_file.MessageEnd ();

Can anyone confirm the format it has been saved in? By this I mean that
too me it looks like its been DER encoded and then hex encoded.




The private key is saved in asn.1 format as per the RSA PKCS descriptions. The format contains an "object" that identifies it as an RSA key. The actual RSA is encoded as an OCTET STRING, which is itself a BER sequence of the numerical values that make up the key. They are described, I believe, as BER encodings, but are generated as conforming to DER.



Reply via email to