Ejemplo n.º 1
0
        public void TestVerifyLicenseKey()
        {
            var mgr = new DefaultLicenseManager();
            var ret = mgr.VerifyLicenseKey(new LicenceVerifyOption
            {
                AppKey      = "test",
                EncryptKind = LicenseEncryptKinds.RSA,
                LocalKey    = "AQLZlMVvXQktYVIxFY5IEd/6iIHOcgCevhYg6FhkZ3f6QQ==",
                LicenseKey  = "2S0BXnEvbioHOVH/8xf2kk3UXnMW3AFLPjnDoKvdvx/F04pFPNo8kOhUuaGOCyKDY3azjNlY121+yoFfCMOTMn73BepoxcDFe+vyWxHRj1sBFmlsYNzhZf1CbJRMfG4EHHzyBn4I5hAixwdcBT0HCFH/Y0448zSqfHXdZjwX4RU=",
                PublicKey   = "<RSAKeyValue><Modulus>23GxSa98EllX44bQXrqT+G1oA6si6Ll0PKhcOdRLkYfZ6mCDX3gY1KNYW7VisAYqokYSxVoVM5g7mH7K3rZ2b3XAemX/KuW8Efl5BHlqY220Uau9JumoisgdeQVxrw84eWUZG1571VNDJFCXh/430EVHZpEhokD3xLZnJFssMik=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>",
            });

            Assert.IsTrue(ret);
        }
Ejemplo n.º 2
0
        public void TestLoadLicenseData()
        {
            var store = new DefaultLicenseDataStore();
            var data  = store.Load <LicenceData>("test");

            Assert.IsNotNull(data);

            var mgr = new DefaultLicenseManager();
            var ret = mgr.VerifyLicenseKey(new LicenceVerifyOption
            {
                AppKey      = "test",
                EncryptKind = LicenseEncryptKinds.RSA,
                LocalKey    = data.LocalKey,
                LicenseKey  = data.LicenceKey,
                PublicKey   = "<RSAKeyValue><Modulus>23GxSa98EllX44bQXrqT+G1oA6si6Ll0PKhcOdRLkYfZ6mCDX3gY1KNYW7VisAYqokYSxVoVM5g7mH7K3rZ2b3XAemX/KuW8Efl5BHlqY220Uau9JumoisgdeQVxrw84eWUZG1571VNDJFCXh/430EVHZpEhokD3xLZnJFssMik=</Modulus><Exponent>AQAB</Exponent></RSAKeyValue>",
            });

            Assert.IsTrue(ret);
        }