question: public static byte [ ] convertDsaXMLDSIGtoASN1 ( byte [ ] xmldsigBytes , int size ) throws IOException { int totalSize = size * 2 ; if ( xmldsigBytes . length != totalSize ) { throw new IOException ( "Invalid XMLDSIG format of DSA signature" ) ; } int i ; for ( i = size ; i > 0 && xmldsigBytes [ size - i ] == 0 ; i -- ) ; int j = i ; if ( xmldsigBytes [ size - i ] < 0 ) { j ++ ; } int k ; for ( k = size ; k > 0 && xmldsigBytes [ totalSize - k ] == 0 ; k -- ) ; int l = k ; if ( xmldsigBytes [ totalSize - k ] < 0 ) { l ++ ; } byte [ ] asn1Bytes = new byte [ 6 + j + l ] ; asn1Bytes [ 0 ] = 48 ; asn1Bytes [ 1 ] = ( byte ) ( 4 + j + l ) ; asn1Bytes [ 2 ] = 2 ; asn1Bytes [ 3 ] = ( byte ) j ; System . arraycopy ( xmldsigBytes , size - i , asn1Bytes , 4 + j - i , i ) ; asn1Bytes [ 4 + j ] = 2 ; asn1Bytes [ 5 + j ] = ( byte ) l ; System . arraycopy ( xmldsigBytes , totalSize - k , asn1Bytes , 6 + j + l - k , k ) ; return asn1Bytes ; }
target:  Converts an XML Signature DSA Value to a ASN.1 DSA value. The JCE DSA Signature algorithm creates ASN.1 encoded (r,s) value pairs (see section 2.2.2 of RFC 3279); the XML Signature requires the core BigInteger values.