예제 #1
0
        public void NotSignedLicenseIsRejected()
        {
            var license        = CreateLicenseFromNewContact();
            var encodedLicense = LicenseWriter.ToString(license);

            LicenseReader.FromString(encodedLicense.Split('.').First());
        }
예제 #2
0
        public void TamperedLicenseIsRejected()
        {
            var license        = CreateLicenseFromNewContact();
            var encodedLicense = new StringBuilder(LicenseWriter.ToString(license));

            encodedLicense[0] = 'A'; // I'd assume we dont already have this sequence...
            encodedLicense[1] = 'B';
            encodedLicense[2] = 'C';
            encodedLicense[3] = 'D';

            LicenseReader.FromString(encodedLicense.ToString());
        }
예제 #3
0
 public void InvalidLicenseIsRejected2()
 {
     LicenseReader.FromString(
         Convert.ToBase64String(Encoding.UTF8.GetBytes("This is an invalid license text")));
 }
예제 #4
0
 public void InvalidLicenseIsRejected1()
 {
     LicenseReader.FromString("This is an invalid license text");
 }