private fun cloneProperties( certificate: BurpCertificate, burpCertificateBuilder: BurpCertificateBuilder { burpCertificateBuilder.setVersion(certificate.getVersionNumber()) burpCertificateBuilder.setSerial(certificate.getSerialNumberBigInteger()) if (certificate.getPublicKeyAlgorithm().equals("RSA")) { burpCertificateBuilder.setSignatureAlgorithm(certificate.getSignatureAlgorithm()) } else { burpCertificateBuilder.setSignatureAlgorithm("SHA256withRSA") } burpCertificateBuilder.setIssuer(certificate.getIssuer()) burpCertificateBuilder.setNotAfter(certificate.getNotAfter()) burpCertificateBuilder.setNotBefore(certificate.getNotBefore()) burpCertificateBuilder.setKeySize(certificate.getKeySize()) for (extension in certificate.getAllExtensions()) { burpCertificateBuilder.addExtension(extension) } }
Copy all X.509v3 general information and all extensions 1:1 from one source certificat to one destination certificate .