public MagicEnvelope(string data, string type, MagicKey key) { _data = _encodeBase64Url(Encoding.UTF8.GetBytes(data)); _dataType = type; _alg = "RSA-SHA256"; _encoding = "base64url"; _signature = _encodeBase64Url(key.Sign(key.BuildSignedData(_data, _dataType, _encoding, _alg))); }
public bool VerifySignatureAgainst(MagicKey key) { return(key.Verify(_signature, key.BuildSignedData(_data, _dataType, _encoding, _alg))); }