Granados.PKI.EdwardsCurve.FindByAlgorithm C# (CSharp) Method

FindByAlgorithm() public static method

public static FindByAlgorithm ( PublicKeyAlgorithm algorithm ) : EdwardsCurve
algorithm PublicKeyAlgorithm
return EdwardsCurve
        public static EdwardsCurve FindByAlgorithm(PublicKeyAlgorithm algorithm)
        {
            switch (algorithm) {
                case PublicKeyAlgorithm.ED25519:
                    return FindByName("edwards25519");
                default:
                    return null;
            }
        }

Usage Example

Esempio n. 1
0
        internal static EDDSAPublicKey ReadFrom(PublicKeyAlgorithm algorithm, SSH2DataReader reader)
        {
            EdwardsCurve curve = EdwardsCurve.FindByAlgorithm(algorithm);

            if (curve == null)
            {
                throw new SSHException(Strings.GetString("UnsupportedEllipticCurve"));
            }

            byte[] q = reader.ReadByteString();
            return(new EDDSAPublicKey(curve, q));
        }