LgoSignatureServiceLocalRsa implements LgoSignatureService { @Override public String digestSignedUrlHeader(String url, String timestamp) { try { String urlToSign = removeProtocol(url); String signatureBaseString = String.format("%s\n%s", timestamp, urlToSign); return buildHeader(signSHA256RSA(signatureBaseString)); } catch (Exception e) { throw new RuntimeException("Error signing request", e); } } LgoSignatureServiceLocalRsa(@NonNull String apiKey, @NonNull String privKey); @Override String digestSignedUrlAndBodyHeader(String url, String timestamp, String body); @Override String digestSignedUrlHeader(String url, String timestamp); @Override LgoOrderSignature signOrder(String encryptedOrder);  }
@Test public void digestHeader() { String digest = signatureService.digestSignedUrlHeader("wss: assertThat(digest) .isEqualTo( String.format( "LGO %s:49fc528952ac62c7fd18524df714c7929900e8da66532cd99f4e7bda74eb22913120f85902afe7d48b1a50639f8a0748b9ffb2c1736189c5a01d9de4c79131dd3911feeb4a5c91290d754bb78700a9b12377059611b21b8853b5ae684d065d1e024a8d0d928bf6e44312620ca586173d838523b4cfd829d3b212a9013064424d832bca63303841def4a922ea777d52e3e1e0ad871278c44a60dfc827dacb25355028a6ef92c449b0ab779ae481c6f7247c0d07707989ac922d7151736c38ab4fe728e36a148851da5b9226ce9ed03cd7ffe66292c79109817a66fff03e1cb71c0f5ab88cb631d0cb776d96727e7d7938cd0c1f4095fc8949960da212e319ec1e", apiKey)); }