Example #1
0
    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();
    }
Example #2
0
        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);
        }