One of my projects requires encrypting data on the iPhone and decrypting it using .Net. This is easy to do with the Common Crypto library in the iPhone SDK and the AesCryptoServiceProvider class in .Net, but the encryption parameters have to be the same for it to work.
I couldn’t figure it out, but the geniuses at StackOverflow did, so I am posting my results here. The zip file includes a basic iPhone app and a .Net console project with helpful classes to do the encryption/decryption and base64 conversion. I didn’t write most of the code – thanks to Blue Beetle for the .Net code and Greg Haygood for the Objective C.
Every now and then, I will post code snippets which others might find useful. Here is one:
How to add an RSS auto-discovery meta tag to the page header:
Private Sub AddRSSLink(ByVal title AsString, ByVal URL AsString)
Dim link AsNew HtmlLink
link.Attributes.Add("type", "application/rss+xml")
link.Attributes.Add("rel", "alternate")
link.Attributes.Add("title", title)
link.Attributes.Add("href", URL)
Page.Header.Controls.Add(link)
End Sub
What about meta tags?
Dim hm AsNew HtmlMeta()
hm.Name="Description"' Or Keywords
hm.Content = "Description..."
Page.Header.Controls.Add(hm)
Why not just put this in the .aspx you ask? Check out the tags on this page for the answer.
n. 1: automatic, but with an element of magic. 2: too complex to understand and/or explain