Exemple #1
0
        internal static void KeyInfoFromPublicBlob(byte[] blob, out byte[] x, out byte[] y)
        {
            x = null;
            y = null;
            var  m       = new Marshaller(blob);
            uint magic   = BitConverter.ToUInt32(m.GetNBytes(4), 0);
            bool magicOk = AlgInfo.Any(xx => xx.Magic == magic);

            if (!magicOk)
            {
                Globs.Throw <ArgumentException>("KeyInfoFromPublicBlob: Public key blob magic not recognized");
            }

            uint cbKey = BitConverter.ToUInt32(m.GetNBytes(4), 0);

            x = m.GetNBytes((int)cbKey);
            y = m.GetNBytes((int)cbKey);
        }