forked from veracode/example-java-gradle
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMain.java
More file actions
31 lines (22 loc) · 731 Bytes
/
Main.java
File metadata and controls
31 lines (22 loc) · 731 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package com.srcclr;
import org.apache.commons.fileupload.MultipartStream;
import org.apache.xml.security.signature.XMLSignatureInput;
import org.mindrot.jbcrypt.BCrypt;
import java.io.ByteArrayInputStream;
import java.io.IOException;
public class Main {
public static void main(String[] args) {
String candidate = args[0];
String hashed = BCrypt.hashpw(candidate, BCrypt.gensalt(12));
BCrypt.checkpw(candidate, hashed);
filterXMLSignature();
}
private static void filterXMLSignature() {
byte[] bytes = new byte[256];
try {
new MultipartStream(new ByteArrayInputStream(bytes), bytes);
} catch (IOException ignored) {
}
new XMLSignatureInput(bytes).addNodeFilter(null);
}
}