MCPcopy Create free account
hub / github.com/ValveSoftware/GameNetworkingSockets / GetAsPEM

Method GetAsPEM

src/common/keypair.cpp:556–568  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

554//-----------------------------------------------------------------------------
555
556bool 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
570bool CECSigningPrivateKey::LoadFromAndWipeBuffer( void *pBuffer, size_t cBytes )
571{

Callers 2

GenKeyPairFunction · 0.80
TestOpenSSHEd25519Function · 0.80

Calls 5

SecureZeroMemoryFunction · 0.85
GetBinaryDataAsPEMFunction · 0.85
TellPutMethod · 0.80
BaseMethod · 0.45

Tested by 1

TestOpenSSHEd25519Function · 0.64