This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.yourcomany.util.net; | |
import org.springframework.integration.ip.tcp.connection.TcpConnectionInterceptorFactory; | |
import org.springframework.integration.ip.tcp.connection.TcpConnectionInterceptorSupport; | |
import org.springframework.integration.support.MessageBuilder; | |
import org.springframework.messaging.Message; | |
import javax.net.ssl.SSLPeerUnverifiedException; | |
import javax.net.ssl.SSLSession; | |
import java.security.cert.Certificate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static void main(String[] args) throws Exception { | |
String prefixes = IOUtils.toString(new URL("https://stat.ripe.net/data/announced-prefixes/data.json?resource=AS32934").openStream()); | |
ObjectMapper mapper = new ObjectMapper(); | |
JsonNode root = mapper.readTree(prefixes); | |
for (JsonNode prefixNode : root.get("data").get("prefixes")) { | |
try { | |
String prefix = prefixNode.get("prefix").asText(); | |
// skip IPv6 | |
if (!prefix.contains(":")) { | |
String updates = IOUtils.toString(new URL("https://stat.ripe.net/data/bgp-updates/data.json?resource=" + prefix).openStream()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
31.13.71.0/24 | 816 | 1 | |
---|---|---|---|
179.60.192.0/22 | 930 | 2 | |
102.132.99.0/24 | 17 | 11 | |
129.134.29.0/24 | 5751 | 473 | |
31.13.84.0/24 | 747 | 1 | |
157.240.14.0/24 | 739 | 1 | |
157.240.226.0/24 | 57 | 5 | |
129.134.0.0/17 | 916 | 2 | |
102.132.96.0/20 | 910 | 2 | |
173.252.64.0/19 | 911 | 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class MachineProtocolSignatureVerifier { | |
public static void main(String[] args) throws Exception { | |
String toVerify = FileUtils.readFileToString(new File("C:\\Users\\user\\Downloads\\010300076\\010300076.csv")); | |
String signed = "<<base64 from p7s file>>"; | |
byte[] signedByte = Base64.getDecoder().decode(signed); | |
Security.addProvider(new BouncyCastleProvider()); | |
CMSSignedData cms = new CMSSignedData(new CMSProcessableByteArray(toVerify.getBytes()), signedByte); | |
OlderNewer