use of de.rub.nds.tlsattacker.core.constants.SignatureAndHashAlgorithm in project TLS-Scanner by RUB-NDS.
the class ProtocolVersionProbe method getTls13SignatureAndHashAlgorithms.
private List<SignatureAndHashAlgorithm> getTls13SignatureAndHashAlgorithms() {
List<SignatureAndHashAlgorithm> algos = new LinkedList<>();
algos.add(new SignatureAndHashAlgorithm(SignatureAlgorithm.RSA, HashAlgorithm.SHA256));
algos.add(new SignatureAndHashAlgorithm(SignatureAlgorithm.RSA, HashAlgorithm.SHA384));
algos.add(new SignatureAndHashAlgorithm(SignatureAlgorithm.RSA, HashAlgorithm.SHA512));
algos.add(new SignatureAndHashAlgorithm(SignatureAlgorithm.ECDSA, HashAlgorithm.SHA256));
algos.add(new SignatureAndHashAlgorithm(SignatureAlgorithm.ECDSA, HashAlgorithm.SHA384));
algos.add(new SignatureAndHashAlgorithm(SignatureAlgorithm.ECDSA, HashAlgorithm.SHA512));
algos.add(new SignatureAndHashAlgorithm(SignatureAlgorithm.RSA_PSS, HashAlgorithm.SHA256));
algos.add(new SignatureAndHashAlgorithm(SignatureAlgorithm.RSA_PSS, HashAlgorithm.SHA384));
algos.add(new SignatureAndHashAlgorithm(SignatureAlgorithm.RSA_PSS, HashAlgorithm.SHA512));
return algos;
}
use of de.rub.nds.tlsattacker.core.constants.SignatureAndHashAlgorithm in project TLS-Scanner by RUB-NDS.
the class CertificateReportGenerator method setSignatureAndHashAlgorithm.
private static void setSignatureAndHashAlgorithm(CertificateReportImplementation report, org.bouncycastle.asn1.x509.Certificate cert) {
String sigAndHashString = null;
try {
X509CertificateObject x509Cert = new X509CertificateObject(cert);
sigAndHashString = x509Cert.getSigAlgName();
if (sigAndHashString != null) {
String[] algos = sigAndHashString.toUpperCase().split("WITH");
if (algos.length != 2) {
LOGGER.warn("Could not parse " + sigAndHashString + " into a reasonable SignatureAndHash algorithm");
return;
}
SignatureAlgorithm signatureAlgorithm = SignatureAlgorithm.valueOf(algos[1]);
HashAlgorithm hashAlgorithm = HashAlgorithm.valueOf(algos[0]);
if (hashAlgorithm == null) {
LOGGER.warn("Parsed an unknown HashAlgorithm");
return;
}
if (signatureAlgorithm == null) {
LOGGER.warn("Parsed an unknown SignatureAlgorithm");
return;
}
SignatureAndHashAlgorithm sigHashAlgo = new SignatureAndHashAlgorithm(signatureAlgorithm, hashAlgorithm);
report.setSignatureAndHashAlgorithm(sigHashAlgo);
}
} catch (Exception E) {
LOGGER.debug("Could not extraxt SignatureAndHashAlgorithm from String:" + sigAndHashString, E);
}
}
Aggregations