Taco Fleur

Greenhorn
+ Follow
since Jul 11, 2005
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Taco Fleur

PS. those really long lines really cannot contain a space otherwise the message would be invalid and the test would not work.
18 years ago
Point taken - tried to edit the code, but there really is not much I can delete, except comments.

If someone would look at this I would think they would just copy and paste it into their favourite IDE.
18 years ago
oops forgot to signup for "Email Notification"..
18 years ago
I have been battling with an issue for more than 3 weeks now, a week ago I contacted the vendor for support and am paying them for it.
Basically what I told them was, I can get this code to work from the command line, but when I call the class via your application server I get an error.
Well, today while on the phone with them I deleted all certificates from my keystore and tried to import it again, and I have not been able to get it working again, which is making me look very bad as they have spend lots of time on it.

My question to you is, can someone please verify that they can get the code working with the certificate? Even willing to pay a little money to get this done..

I know very little about Java and SSL, so if you see something thats not right let me know.

The vendor sent me the following link http://edge1.asic.gov.au/edge/test/EIS_CAcert.pem and they also send me some .key files which at one stage I had seperated and imported.
I am assuming who ever is willing to help out needs the key files, so I posted them here:
www.shelco.com.au/test/edge/Shelco.key.der
www.shelco.com.au/test/edge/Shelco.cert.der

The code is:

Once again, at this stage I am interested to see if someone can get this going from the command line without getting the error "Certificate not found", and then I am interested in seeing step by step how you got it working.

many thanks in advance..
[ August 01, 2005: Message edited by: Jim Yingst ]
18 years ago
What else can I check for to see whats different between running it from main() or calling the class from ColdFusion?
18 years ago
I have a Java class that talks over an SSL socket, and it all works fine when I run the class with a main()

But when I call the class from ColdFusion which is the language I NEED to call this class from I get the following error:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: No trusted certificate found

I have been working on this error for days now and tried many things, during my research I found some documentation that said I also needed to import the certificate for the ColdFusion engine, which I did. When I point the Java class to the Coldfusion keystore it all still runs fine with a main(), which tells me that it imported fine into the CF keystore.

I also thought of calling the class from another language, just so I could see if its a Java or ColdFusion issue, I downloaded the JavaReg tool to register the Class and try and call it via VBScript, but that just errors and wont even let me instantiate the Class, so I can't test that either.

I am running out of options and will be pulling my hair out soon ;-)
18 years ago
Even if I only do
Pattern myValidation = Pattern.compile( "[A-Z]+", Pattern.DOTALL );
myMatch = myValidation.matcher( messagePart );
isValid = myMatch.matches();
it still tells me the match is false.
Maybe I am just missing something vital here.?
The string has characters between A-Z, so it should match right?
I am just trying to take it one step at a time as you suggested.
18 years ago
I added the + as you susgested, I come from another language where you can specify "ALL" i.e. remove all chars in the set ;-)

Pattern myValidation = Pattern.compile( "[^" + VALID_MESSAGE_PATTERN + "]+", Pattern.DOTALL );
myMatch = myValidation.matcher( messagePart );
isValid = myMatch.matches();
if ( !isValid )
{

However it still complains saying the message is invalid.
18 years ago
Hi,

first I want to make sure there are no other characters than the allowed characters, i.e. the ones in the regex, then if there are characters in the message outside the allowed range then I want to display the invalid characters, removing all valid characters shouls leave all the invalid characters, right?

The removing works like a charm it removes all the valid chars, but the check to see if there are any characters outside the range is giving me troubles.
18 years ago
Hi thanks,

at least it doesnt error this time. but it doesnt work as it should either ;-)

Pattern myValidation = Pattern.compile( "[^" + VALID_MESSAGE_PATTERN + "]", Pattern.DOTALL );
myMatch = myValidation.matcher( messagePart );
isValid = myMatch.matches();
if ( !isValid )
{
setError( "Invalid message format, message: " + messagePart + " Invalid characters are: " + messagePart.replaceAll( "[" + VALID_MESSAGE_PATTERN + "]", "" ) );
}

This is the string I run it on: ZHDASCTXID0400\nZTX777Y20050711777571\nZTRENDTXID3\n

The output is:
Invalid message format, message: ZHDASCTXID0400
ZTX777Y20050711777571
ZTRENDTXID3
Invalid characters are:

which I do not understand, because it says there are invalid characters, but when I remove all valid characters from the string nothing is left.
18 years ago
I was undert the impression that \\ would escape characters in a character class, but it doesnt seem to work for me.

java.util.regex.PatternSyntaxException: Illegal octal escape sequence near index 4
[^\0-9A-Z\p{Blank}
^_`~\p{Punct}]

I need to allow the following characters
\
0-9
A-Z
\p{Blank}
\r
\n
^_`~
\p{Punct}
[]{}|

How would I format the regex?
I tried:
[^\\0-9A-Z\\p{Blank}\r\n^_`~\\p{Punct}\\[\\]\\{\\}\\|]
18 years ago
Can anyone point me to a really good tutorial for importing Certificates and Keys?

Situation:
I have an SSL connection working with an unsigned (or was it untrusted?) certificate (Shelco.cert.der) issued by someone, I also have a key (Shelco.key.der) provided by them, and I am successfully signing messages.

Along the lines I have sort of lost sight as to what is for what.
I am completely new to Java but have been able to piece things together but as I said lost sight as to what is for what, so if someone could either point me to a really good tutorial or give me a run down I would really appreciate it.

Questions I have:
- which of the two are required for signing messages, just the key or both cert and key?
- which of the two are required for a successfull SSL connection, I am assuming it is both?
- the provider also send me a link to the CA Certificates copies
http://edge1.asic.gov.au/edge/test/EIS_CAcert.pem
http://edge2.asic.gov.au/edge/test/EIS_CAcert.pem
Are they the same as the cert. and key they send me? and can I safely ignore them?
- what are the commands for importing the key? I have the command for importing the certificate but that raises another question;
- am I doing the right thing importing the cert to the following keystore
C:\Documents and Settings\Administrator\.keystore it does not look right to me, but it works, when I import the cert for ColdFusion I run the following which looks more like the right thing
18 years ago
PS. any idea why I am not getting an alert via my email when a new reply is posted? I am assuming you are one of the admins.
18 years ago
I could be asking the same about "Jim Yingst" Looks to me like Jim is a made up name since your last name looks asian ;-)

And yes it is my real name - Good thing is, there is only ONE Taco Fleur in the whole wide world! ;-)

Thanks.
18 years ago
PS. the problme at the moment is that it always says it contains invalid chars, but when removing all valid chars nothing is left, i.e. there are no invalid chars.
18 years ago