コード例 #1
0
ファイル: OmniAgreement.cs プロジェクト: omnius-labs/core
    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();
    }
コード例 #2
0
ファイル: OmniAgreement.cs プロジェクト: KeitoTobi1/core
        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);
        }