Search in sources :

Example 21 with ScannerRuntimeException

use of com.checkmarx.sdk.exception.ScannerRuntimeException in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.

the class AstClientHelper method getLatestScanResults.

@Override
public ResultsBase getLatestScanResults() {
    log.error("Unsupported Operation.");
    ASTResults result = new ASTResults();
    result.setException(new ScannerRuntimeException(new UnsupportedOperationException()));
    return result;
}
Also used : ScannerRuntimeException(com.checkmarx.sdk.exception.ScannerRuntimeException)

Example 22 with ScannerRuntimeException

use of com.checkmarx.sdk.exception.ScannerRuntimeException in project checkmarx-spring-boot-java-sdk by checkmarx-ltd.

the class Sha1SignatureCalculator method calculateSignature.

@Override
public CxSCAFileSignature calculateSignature(byte[] content) throws ScannerRuntimeException {
    MessageDigest digest;
    try {
        digest = MessageDigest.getInstance("SHA-1");
    } catch (NoSuchAlgorithmException e) {
        throw new ScannerRuntimeException("Unable to use SHA-1 algorithm", e);
    }
    digest.update(content);
    return new CxSCAFileSignature(SHA1_SIGNATURE_TYPE_NAME, Hex.encodeHexString(digest.digest()));
}
Also used : NoSuchAlgorithmException(java.security.NoSuchAlgorithmException) MessageDigest(java.security.MessageDigest) ScannerRuntimeException(com.checkmarx.sdk.exception.ScannerRuntimeException)

Aggregations

ScannerRuntimeException (com.checkmarx.sdk.exception.ScannerRuntimeException)22 IOException (java.io.IOException)6 UnsupportedEncodingException (java.io.UnsupportedEncodingException)5 CheckmarxException (com.checkmarx.sdk.exception.CheckmarxException)4 CxHTTPClientException (com.checkmarx.sdk.exception.CxHTTPClientException)4 MalformedURLException (java.net.MalformedURLException)3 URL (java.net.URL)3 JAXBException (javax.xml.bind.JAXBException)3 UrlEncodedFormEntity (org.apache.http.client.entity.UrlEncodedFormEntity)3 RestClientConfig (com.checkmarx.sdk.config.RestClientConfig)2 Package (com.checkmarx.sdk.dto.sca.report.Package)2 Severity (com.checkmarx.sdk.dto.scansummary.Severity)2 URISyntaxException (java.net.URISyntaxException)2 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)2 URIBuilder (org.apache.http.client.utils.URIBuilder)2 ModelMapper (org.modelmapper.ModelMapper)2 AstConfig (com.checkmarx.sdk.config.AstConfig)1 TokenLoginResponse (com.checkmarx.sdk.dto.TokenLoginResponse)1 Finding (com.checkmarx.sdk.dto.ast.report.Finding)1 ScaUploadUrlRequest (com.checkmarx.sdk.dto.sca.ScaUploadUrlRequest)1