private static byte[] encode(byte[] signedStream) throws DSSException {
  final int half=signedStream.length / 2;
  final byte[] firstPart=new byte[half];
  final byte[] secondPart=new byte[half];
  System.arraycopy(signedStream,0,firstPart,0,half);
  System.arraycopy(signedStream,half,secondPart,0,half);
  final BigInteger r=new BigInteger(1,firstPart);
  final BigInteger s=new BigInteger(1,secondPart);
  final ASN1EncodableVector v=new ASN1EncodableVector();
  v.add(new DERInteger(r));
  v.add(new DERInteger(s));
  return DSSASN1Utils.getDEREncoded(new DERSequence(v));
}

private static byte [ ] encode ( byte [ ] signedStream ) throws DSSException { final int half = signedStream . length / 2 ; final byte [ ] firstPart = new byte [ half ] ; final byte [ ] secondPart = new byte [ half ] ; System . arraycopy ( signedStream , 0 , firstPart , 0 , half ) ; System . arraycopy ( signedStream , half , secondPart , 0 , half ) ; final BigInteger r = new BigInteger ( 1 , firstPart ) ; final BigInteger s = new BigInteger ( 1 , secondPart ) ; final ASN1EncodableVector v = new ASN1EncodableVector ( ) ; v . add ( new DERInteger ( r ) ) ; v . add ( new DERInteger ( s ) ) ; return DSSASN1Utils . getDEREncoded ( new DERSequence ( v ) ) ; }
the ecdsa_sig structure consists of two bignums for the r and s value of a ecdsa signature ( see x9 . 62 or fips 186 - 2 ) . < br > this encoding is not implemented at the level of mocca !
