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

Method GetPublicKey

src/common/keypair.cpp:498–521  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

496}
497
498bool CEC25519PrivateKeyBase::GetPublicKey( CEC25519PublicKeyBase *pPublicKey ) const
499{
500 pPublicKey->Wipe();
501
502 if ( m_eKeyType == k_ECryptoKeyTypeKeyExchangePrivate )
503 {
504 Assert( pPublicKey->GetKeyType() == k_ECryptoKeyTypeKeyExchangePublic );
505 if ( pPublicKey->GetKeyType() != k_ECryptoKeyTypeKeyExchangePublic )
506 return false;
507 }
508 else if ( m_eKeyType == k_ECryptoKeyTypeSigningPrivate )
509 {
510 Assert( pPublicKey->GetKeyType() == k_ECryptoKeyTypeSigningPublic );
511 if ( pPublicKey->GetKeyType() != k_ECryptoKeyTypeSigningPublic )
512 return false;
513 }
514 else
515 {
516 Assert( false ); // impossible, we must be one or the other if valid
517 return false;
518 }
519
520 return pPublicKey->SetRawDataWithoutWipingInput( m_publicKey, 32 );
521}
522
523bool CEC25519PrivateKeyBase::MatchesPublicKey( const CEC25519PublicKeyBase &publicKey ) const
524{

Callers 5

CreateCertFunction · 0.80
CreateHostedServerTicketFunction · 0.80
TestEllipticCryptoFunction · 0.80

Calls 3

GetKeyTypeMethod · 0.80
WipeMethod · 0.45

Tested by 1

TestEllipticCryptoFunction · 0.64