> I need to know the format of this byte array so i can
> separate and extract the r & s values.
>
> Would you please send me a description of this
> byte array result. or confirm the following layout:
>
> offset length description
> ------ ------ -----------
> 0 1 always contains 48 when no init
> 1 1 length of the rest of the array
> 2 n byte representation of BigInteger r
> 2+n m byte representation of BigInteger s
>
> what are the specific values?
The signature is encoded as an ASN.1 SEQUENCE of two ASN.1 INTEGERs
"r" and "s".
For example, below is the signature created using a 512-bit modulus:
30:2C:02:14:06:8F:7E:0A:2D:86:50:FC:09:51:3E:F0:0E:11:
D6:C2:05:F5:7E:FE:02:14:23:02:45:60:B5:31:93:4C:83:74:
3F:2B:C7:50:65:1F:65:AB:39:FF
Here's an explanation of each byte in the encoding:
30 - SEQUENCE tag
2C - length
02 - INTEGER tag
14 - length (=> 20 bytes)
06:8F:7E:0A:2D:86:50:FC:09:51:3E:F0:0E:11:D6:C2:05:F5:7E:FE - "r" value
02 - INTEGER tag
14 - length (=> 20 bytes)
23:02:45:60:B5:31:93:4C:83:74:3F:2B:C7:50:65:1F:65:AB:39:FF - "s" value
Jan