SshSignatureConverter { public static byte[] getSshSignatureEcDsa(byte[] rawSignature, String curveOid) throws NoSuchAlgorithmException { SshEncodedData signature = new SshEncodedData(); signature.putString("ecdsa-sha2-" + SshUtils.getCurveName(curveOid)); signature.putString(getEcDsaSignatureBlob(rawSignature)); return signature.getBytes(); }  static byte[] getSshSignatureEdDsa(byte[] rawSignature); static byte[] getSshSignatureDsa(byte[] rawSignature); static byte[] getSshSignatureRsa(byte[] rawSignature, int hashAlgorithm); static byte[] getSshSignatureEcDsa(byte[] rawSignature, String curveOid);  }
@Test public void testEcDsa() throws Exception { byte[] out = SshSignatureConverter.getSshSignatureEcDsa(RAW_ECDSA_SIGNATURE, CURVE_OID_NIST_P_256); Assert.assertArrayEquals(SSH_ECDSA_SIGNATURE, out); }