How long is the field 52 on your interface, what form should it come in as?
> However, what i need is the exact value "3FB5856E8EA7E797" to be read.
>
Of course this is desirable 8), but is field supplied as character hex
or binary or something else?
> To help this cause i changed it to IF_CHAR, but it gave a unpacking
> error as it was expecting 30 for 0, 33 for 3 etc
IF_CHAR would work if the field was characters, but you would need the
right length (16?). You would need to convert to binary (perhaps)
yourself though.
>
> Please let me know a field packager which can read the exact 16 digit
> pinblock sent by mastercard as is.
MasterCard International or MasterCard Europe - this might be a loaded
question...
... have your checked your interface documentation?
8)
>
> Note: Also i tried to convert "F577F777" back to hex using
> ISOUtil.hexString(), however the resulting string was 16 digit hex but
> did not match the original pinblock and as a result i am not able to
> decrypt it.
As I said, I think you are misaligned, please check all of the fields
up to 52 match the specification?
Adding a Logger to you Channel and Packager will help you see how the
data is being parsed too.
--
Mark
> Yes, it is for Mastercard international and the DE 52 element is 16
> digits Hexadecimal encoded
This feels wrong from memory GAI is binary?
>
> I tried IF_CHAR (8). I am able to read the characters now.
But you said hexadecimal which would mean 16 characters for 8 bytes of
binary bitmap?
If this is what you are doing, you are placing binary data inside a
CHARacter representation.
Please try:-
<isofield
id="52"
length="8"
name="PIN Data"
class="org.jpos.iso.IFB_BINARY"/>
As you Packager definition?
>
> Right value in the BITMAP: 5E818656488B9348
Is the above the raw value you see in a dump/trace of the entire
message? The 'dumper' is presenting the binary data in hex for you.
> unpacked Value : ^??VH??H
This is the ASCII representation of the binary data with ? marking non
ASCII characters? This is where you are 'loosing' the resolution/data.
> After hexString : 5E3F3F56483F3F48
This is the hexadecimal character representation of the ASCII characters
you 'printed' above and have passed to hexString. Please check
http://www.asciitable.com/ for a manual breakdown.
>
> Value read is slightly different from what i can see from the bitmap.
>
> This is what i did to read it back:
> ISOComponent pinBlk = iso.getComponent (52);
Try iso.getString(52) with the field definition above instead.
> byte[] bytePinBlk = pinBlk.getBytes();
This is one problem, you are asking java to present the binary data
placed in CHARacter field as byte[], the default encoding on your
platform might play tricks and is I think introducing some mangling of
your data.
> bean.pinblock = ISOUtil.hexString(bytePinBlk);
This is doing exactly what you ask, converting "^??VH??H" ASCII
characters in their hex form.
>
> As i said before the BITMAP shows the correct pinblock and i have
> successfully decrypted it too. However, the issue is after unpacking
> the value is slightly altered and thereby decryption fails.
>
So manually works, after seeing the code you have the problem is more
obvious as indicated above.
--
Mark
I think you have pasted the wrong values into this message, those two
strings look the same to me.
>
> I think i am doing a stupid mistake somewhere :-(.
You will get there, you are close, please see my reply to your last posting.
I hope all will become clear for you.
--
Mark
> As you said, ALL IS WELL NOW :-)
>
> After changing it to IFB_BINARY (8)
>
Good.
> I am able to translate the pinblock successfully. Thanks a tonn for
> your help.
No problem.
>
> It was amazing how little changes i have made to the default packager
> (jpos 1.6.4 - EuroPackager/PostChannel) to get certified for
> mastercard issuing and acquiring. One change i can recommend is the
> above IFB_BINARY(8) which was defaulted to IFA_BINARY(4) for PIN DATA
> (DE52)
jpos6/modules/jpos/cfg/packager/europay.xml is the genericPackager
definition and already uses IFB_BINARY for field 52, so perhaps an
alignment is needed.
>
> Will get back to you on parsing DE 48 PDS fields.
On a nice new thread would be great 8).
You will hopefully find you only need to set the length value on the
subfields of 48 that you want to see/use.
>
> Also just a question, do you have a standard packager for IPM clearing
> (ASCII and EBCEDIC). Not that i have an issue, it is working well for
> me, but not sure what changes i had made to it (long ago) from the
> default configurations.
Not in the repository. I have often wondered if anyone would/could
contribute; Clearings are not my 'thing', although I would like to see
support for the file format added via a Packager.
I think the MasterCard files hold ISO8583 format records, but am not
certain.
--
Mark
Check ANS X9.24
Once you’ve got the binary image of your pinblock, you just need to call set(52, byte[]) on your ISOMsg object.
--
--
jPOS is licensed under AGPL - free for community usage for your open-source project. Licenses are also available for commercial usage. Please support jPOS, contact: sa...@jpos.org
---
You received this message because you are subscribed to the Google Groups "jPOS Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jpos-users+...@googlegroups.com.
To post to this group, send email to jpos-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jpos-users/CAAgSK%3D%3Dxa-q1QoWio%2BTKuV2XOmj-rLrMRiH4WmjhZpT5HAksNQ%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.