Esempio n. 1
0
        private static ECPoint DecodePublicKey(AnonymousTokenKey key)
        {
            var curve = CustomNamedCurves.GetByName(key.Crv);

            return(curve.Curve.CreatePoint(
                       new BigInteger(Convert.FromBase64String(key.X)),
                       new BigInteger(Convert.FromBase64String(key.Y))
                       ));
        }
Esempio n. 2
0
        private static ECPublicKeyParameters DecodePublicKey(AnonymousTokenKey key)
        {
            var curve = CustomNamedCurves.GetByName(key.Crv);
            var clientSidePublicKeyPoint = curve.Curve.CreatePoint(
                new BigInteger(Convert.FromBase64String(key.X)),
                new BigInteger(Convert.FromBase64String(key.Y))
                );

            return(new ECPublicKeyParameters("ECDSA", clientSidePublicKeyPoint, new ECDomainParameters(curve)));
        }