programming

How to generate public/private keypair with RSA?

I'm developing several projects which use public/private key cryptography. So, the question is simple: how to generate public/private key pair?

As for me, I use OPENSSL to generate RSA key pair. It's simple:

openssl genrsa -out mykey.pem 2048

And public key can be generated like this:


openssl rsa -in mykey.pem -pubout > mykey.pub


OCJAP 7. Tip 1: int ArrayList is valid name for variable

I'm currently preparing for Oracle Certified Associate, Java SE 7 Programmer (OCJAP 7) exam So, I would like to post some tips for myself and probably others.

Tip for today is quite simple: any class name might be used as variable name. For instance:

[geshifilter-java] // These are valid identifiers int ArrayList; boolean Boolean; char String; // ... public class TestSimple {} double TestSimple; [/geshifilter-java]

How to load Spring Application context for jUnit from WEB-INF?

I'm using jUnit for writing unit tests for my applications.

It's easy to load applicationContext.xml when it's in classpath:

[geshifilter-java] @RunWith(SpringJUnit4ClassRunner.class) @ContextConfiguration(locations = {"classpath*:applicationContext.xml"}) public abstract class DefaultApplicationContext { // Code [/geshifilter-java]

But how to load application context not from classpath, but from custom directory, for example WEB-INF?

Solution is to use Maven's path:

My Expierence With Emulator of Android Development Tools 11

Yesterday I installed the latest version (currently - 11th) of Android Development Tools into my ASUS X53Ka (AMD Athlon X2 64 TK-57 1.9 GHz, 4 GB of RAM). But the emulator loads very slowly - I've waited for about 5 minutes but the emulator haven't started (the title "Android..." was still blinking).

So, what I did? I pressed on Window->Android SDK and AVD Manager and changed some options a bit:

Integration testing

I have to make a small speach about Integration testing on Wednesday. So, I wrote down some main points I would like to discuss. I think they might be interesting for the readers of my blog. Here are they.

 

Integration testing ("I&T") is the phase in software testing in which individual software modules are combined and tested as a group.

ActivityNotFoundException on Android?

I am creating a small Android client for my Master's theses. Unfortunately, I've encountered a problem: I get ActivityNotFoundException during runtime process. I just need to change the activity of my program (to show the help box). Maybe someone could give me a hint what I'm doing wrong?

My main file/activity looks like that:

package info.ernestas.uvrsclient;

My first JavaME program aka Hello, World on Mobile phone

I wanted to try the JavaME framework. And I tried it. The first program I made was a simple program which shows an alert box with the text you entered. Interesting point is that the menu buttons look different then in my "Sony Ericsson K550i". In the emulator - the "Exit" is on the right, but in my mobile phone it's on the left. At the moment I don't have any idea why, but...