How to extract raw 64 byte EC signature from an ASN1/DER encoded signature (which ranges from 70 - 72 bytes) I see that my ASN1/DER signature contains the individual r and s values, is there a way to derive the generic 64byte signature?

edit:  Ive looked through the DER/ASN1 spec, seems that what Im looking for is simply s appended to r.  BUT both r and s can possibly have lengths of 32 or 33.  so its possible for my raw EC signature to be 66 bytes long, which completely breaks the application I use now.

But Ive noticed that whenever the DER specifies eother r or s to be 33 bytes long, the very first byte is 0x00.  I suppose I can simply throw that out and then have 64 bytes?
You are on the right track. R and S data bytes typically encode 256-bit values (32 bytes). However, integers in DER are signed, which means that if their highest bit is set, they are interpreted as negative. For that reason, if the R or S value being encoded has their first byte >= 0x80, it would mean a negative number, and hence a null byte is appended taking the length to 33 bytes. So to encode the signature to 64 bytes, just take the last 32 bytes each of the R and S values.