| 554 | //----------------------------------------------------------------------------- |
| 555 | |
| 556 | bool CECSigningPrivateKey::GetAsPEM( char *pchPEMData, uint32_t cubPEMData, uint32_t *pcubPEMData ) const |
| 557 | { |
| 558 | if ( !IsValid() ) |
| 559 | return false; |
| 560 | uint8 privateKey[ 32 ]; |
| 561 | VerifyFatal( GetRawData( privateKey ) == 32 ); |
| 562 | |
| 563 | CAutoWipeBuffer bufTemp; |
| 564 | OpenSSHBinaryWriteEd25519Private( bufTemp, privateKey, GetPublicKeyRawData() ); |
| 565 | SecureZeroMemory( privateKey, sizeof(privateKey) ); |
| 566 | |
| 567 | return GetBinaryDataAsPEM( pchPEMData, cubPEMData, pcubPEMData, bufTemp.Base(), bufTemp.TellPut(), k_szOpenSSHPrivatKeyPEMHeader, k_szOpenSSHPrivatKeyPEMFooter ); |
| 568 | } |
| 569 | |
| 570 | bool CECSigningPrivateKey::LoadFromAndWipeBuffer( void *pBuffer, size_t cBytes ) |
| 571 | { |