Example #1
0
 public bool Validate()
 {
     using (RSAKey rSAKey = new RSAKey(this.RSAPublicKey))
     {
         this.validated = RSAFunctions.VerifyData(rSAKey, this.HexStringToByteArray(this.LicenseHash), this.StringToBytes(this.ToStringInternal()));
     }
     return(this.IsValid);
 }
Example #2
0
 public static byte[] SignData(RSAKey key, byte[] dataToSign)
 {
     return(key.Key.SignData(dataToSign, new SHA1CryptoServiceProvider()));
 }
Example #3
0
 public void Sign(RSAKey privateKey)
 {
     this.LicenseHash = this.ByteArrayToHex(RSAFunctions.SignData(privateKey, this.StringToBytes(this.ToStringInternal())));
 }
Example #4
0
 public static bool VerifyData(RSAKey key, byte[] hash, byte[] dataSigned)
 {
     return(key.Key.VerifyData(dataSigned, new SHA1CryptoServiceProvider(), hash));
 }