Exemplo n.º 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);
 }
Exemplo n.º 2
0
 public static byte[] SignData(RSAKey key, byte[] dataToSign)
 {
     return(key.Key.SignData(dataToSign, new SHA1CryptoServiceProvider()));
 }
Exemplo n.º 3
0
 public void Sign(RSAKey privateKey)
 {
     this.LicenseHash = this.ByteArrayToHex(RSAFunctions.SignData(privateKey, this.StringToBytes(this.ToStringInternal())));
 }
Exemplo n.º 4
0
 public static bool VerifyData(RSAKey key, byte[] hash, byte[] dataSigned)
 {
     return(key.Key.VerifyData(dataSigned, new SHA1CryptoServiceProvider(), hash));
 }