public static byte[] GetSecret(OmniAgreementPublicKey publicKey, OmniAgreementPrivateKey privateKey) { if (publicKey.AlgorithmType == OmniAgreementAlgorithmType.EcDh_P521_Sha2_256 && privateKey.AlgorithmType == OmniAgreementAlgorithmType.EcDh_P521_Sha2_256) { return(EcDh_P521_Sha2_256.GetSecret(publicKey.PublicKey, privateKey.PrivateKey)); } throw new NotSupportedException(); }
public static ReadOnlyMemory <byte> GetSecret(OmniAgreementPublicKey publicKey, OmniAgreementPrivateKey privateKey) { if (publicKey.AlgorithmType == OmniAgreementAlgorithmType.EcDh_P521_Sha2_256 && privateKey.AlgorithmType == OmniAgreementAlgorithmType.EcDh_P521_Sha2_256) { return(EcDh_P521_Sha2_256.GetSecret(publicKey.PublicKey, privateKey.PrivateKey)); } return(null); }