/// <summary> /// Calculates/Generates Secrets and KeyResponse given an incoming KeyRequest. /// </summary> /// <param name="keyRequest"></param> /// <returns>Secrets and KeyResponse to send back.</returns> public static SecretsAndKeyResponse GenerateSecretsAndKeyResponse(KeyRequest keyRequest) { var encPubAndSec = _calculateMyPublicKeyAndSecret(keyRequest.Aenc); var Benc = encPubAndSec.MyPublicKey; var Senc = encPubAndSec.SharedSecretKey; var hmacPubAndSec = _calculateMyPublicKeyAndSecret(keyRequest.Ahmac); var Bhmac = hmacPubAndSec.MyPublicKey; var Shmac = hmacPubAndSec.SharedSecretKey; var secrets = new Secrets(Senc, Shmac); var keyResponse = new KeyResponse(keyRequest.RequestId, Benc, Bhmac); return(new SecretsAndKeyResponse(secrets, keyResponse)); }
public SecretsAndKeyResponse(Secrets secrets, KeyResponse keyResponse) { Secrets = secrets; KeyResponse = keyResponse; }