Windows App and Asp.Net Encryption - asp.net

I developed a asp.net webservice for a Xamarin app. I used a encryption class based on System.Security.Cryptography library
Now I want to develop the Universal App version, but I need to use Windows.Security.Cryptography library
I know they are different libraries, but there is a way to encrypt and decrypt in the same way? Or if not, there is any common library?
Thanks

Take a look at PCLCrypto. With that you can use the same library for all the different project types. The library doesn't implement any cryptographic algorithms itself but relies on the platform specific implementations, so it's as safe to use as what you're doing now.

Related

What kind of project I should create for Xamarin.Form(Shared or .Net Standard)?

I have to create app as following.
1- App should work with Android and iOS.
2- Resolution should support to Mobile and Tabs
3- Data storage is on cloud. So, Restful API call will be there for
data transactions
4- There might be local storage for configuration settings
5- There might be native code for some functionalities like implement UrbanAirship Notification, Facebook etc
When I create project for Xamarin.Forms, I get 2 options to create application:
1- Shared, 2- .Net Standard.
I have tried with both. One point is that I haven't found library that contains name like .Shared or .Portable that I have found in one of my old project.
Here is comparision. Please suggest me which type of project I should create for my next project.
Thank you.
At the end it boils down to a matter of taste. The main difference is
shared projects are included in your platform projects as if the source code files were part of the projects themselves
.NET Standard projects are compiled to their own assembly
.NET Standard superseded the portable class libraries. The latter are deprecated and should not be used anymore. There would be no reason for anyway, since .NET Standard is way more convinient and supports a greater subset of .NET (effectively - depending on the PCL profile, but that one compatible with Xamarin was quite limited, e.g. there was very little support for the classes from System.IO).
There are pros and cons both for .NET Standard and shared projects. In shared projects you can use classes directly in your platform projects (anyway, this might be not advisable if you are trying to develop SOLID code), but you'll have to to use #ifdefs to use code that is compatible with only one of the platforms. With .NET Standard you may need to write classes containg platform dependent code twice and load them via DependencyService or - even better - a fully fledged IoC container, but therefor they are much cleaner and concerns are seperated much better.
In the times of PCL there were good reasons to go a hybrid way, e.g. to use System.IO.File from a class that was directly compiled in your platform projects, since both support it, but the PCL Xamarin Profile did not, but with .NET Standard this ain't necessary anymore.
I would always go for .NET Standard libs for the reasons mentioned.
.NET Standard is the future and all plugins and libraries will need to follow and supported it sooner or later.
As in the new prerelease of Xamarin forms 3.0:
We’re now building with .NET Standard 2.0, using the magic of
multi-targeting, while still supporting the PCL profiles and other
.NET Standard versions you may need. Notice how much faster your
projects load when you use .NET Standard project types!
Update To Xamarin.Forms 3.0 prerelease
.NET Standard will provide many features out of the box. Developers are now upgrading their solutions and plugins to support that standard.
.Net Standard. is a new PCL. Use it as if it were a PCL.

What is the difference between user create Java API and Java jar?

I want to create web application that is having some functionality to be platform independent.For that i want to create Java API, but I am confused that is the same thing can be done using jar implementing that functionality?
That are two completely different things and cannot be compared as you did.
An API is an Application Programming Interface, so it defines the methods you can use. (wikipedia link)
A JAR is a Java Archive, it is just a packaged Java Application. (wikipedia link)
An API, by definition, it's just an interface your application/library exposes to other applications to take advantage of your functionality. It doesn't impose any way of implementing it and there is no such a thing as a Java API (unless you mean you have multiple APIs for different programming languages in the form of wrappers). You can build your API just using a regular Java interface, and then pack that in a JAR other Java applications can import and use.
A rest API written in Java will return a JSON payload which can then be read and used by an application written in any programming language. This is the advantage of web services.
A jar will return Java objects as a payload, so is optimal to use if you will be using it exclusively within other Java applications.

Will using dblinq to SQLite in a Windows Store app pass store validation?

I've been trying to figure out how to get a decent LINQ to something working for ORM database access in a Windows Store app.
All I've found is SQLite and the sqlite-net NuGet package. The latter sucks a bit, as I don't get any .dbml like structure which resolves relationships and provides navigation properties for easy querying (no manual joins needed then).
I was wondering:
Does dblinq in comnbination with SQLite offer this?
Will using this pass Windows Store validation?
Thank you !
Update: Some links I used in my research:
The famous Tim Heuer post on SQLite and Windows 8: http://timheuer.com/blog/archive/2012/08/07/updated-how-to-using-sqlite-from-windows-store-apps.aspx
DBlinq: http://code.google.com/p/dblinq2007/
sqlite-net: http://code.google.com/p/sqlite-net/
Interesting discussion stating ADO.NET is not possible: http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/e9cdd75d-03e4-4577-988e-4c02a52e3f50
I'm not familiar with dblinq but by looking at the sqlite tests in the project, it seems the library is offering what you're looking for, i.e. navigation properties for relationships between different tables.
Since dblinq is a .NET library, using it shouldn't make the store validation fail. There is another problem though: you can't use such a .NET library in a Windows Store application, only Windows Store class libraries and portable class libraries are allowed. Since the source for the library is available, you can try compiling it as a Windows Store class library, but I'm afraid there are going to be some classes missing that dblinq is depending on which might make it difficult to port.

ASP.NET web service for Android, iOS and BB

I am creating a web service in ASP.NET that needs to be accessed from Android, iOS and BB. The big stickler here is that I do not want to use any libraries on these mobile platforms to read the transmitted data. I know that Android has a JSON parser built-in, but iOS does not. I also know that WCF-format is out, since none of them read that.
Is my only choice using a proprietary format for the transmitted data to be read by these devices? Has anyone found a good (native) format for the communication with the service across the platforms that doesn't involve creating a proprietary format?
Use JSON. It's built into Android and Blackberry, and there are Objective-C libraries to use it with iOS. It's light and compact and easy to create and parse.
What is "WCF-format"? ASP.NET web services use SOAP by default. WCF services can also be configured to use SOAP or to be RESTful. SOAP is just XML so any framework with an XML parser should do, and with WCF REST you can work with XML or JSON easily.
Your best bet is to use JSON. Although iPhone SDK doesn't have a built-in SDK library, you will easily find an inplematation (json-framework for example). The big benefit willbe that you could configure WCF to output bare JSON, which will be easily understood by all platforms.
REST has less overhead than SOAP, since it is just an HTTP GET/POST/PUT/DELETE. If you need something more than simple CRUD however, SOAP may be appropriate.
Blackberry doesn't have built-in support for JSON as far as I know, at least not for older models. iOS doesn't have built-in support for any of the web services so you have to parse the XML manually if you don't use any third party library. I would say you if you want, you can use JSON with some borrowed library. I chose SOAP because I can use it across platforms including some really old windows mobile phones and I want to use as less third party lib as possible.

Could asp.net unite autocad and mathcad or matlab system?

Needs that autocad uses value from mathcad or matlab? Could I use for it asp.net?
Matlab allows to use its API in different projects written with C#, Java etc.
You need to create Matlab project and convert it to .NET library. Than you will be able to use Matlab API as .NET library in ASP.NET projects.
But as I remember you required Matlab to be installed anyway.
MathCad does not allow to communicate with other frameworks.

Resources