0

Help me to solve this whether I need to install any package I need to use that public key for load test. Creation of public is not working in jmeter.

exp:10001 modulus:0086fa9ba066685845fc03833a9699c8baefb53cfbf19052a7f10f1eaa30488cec1ceb752bdff2df9fad6c64b3498956e7dbab4035b4823c99a44cc57088a23783

jps
  • 20,041
  • 15
  • 75
  • 79
kishore
  • 1
  • 1
  • 1
    Does this answer your question? [Creating RSA keys from known parameters in Java](https://stackoverflow.com/questions/2023549/creating-rsa-keys-from-known-parameters-in-java) – Topaco Sep 18 '22 at 08:19
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Sep 18 '22 at 16:20

1 Answers1

0

If you're talking about client-side certificates - public key alone is not sufficient because you need a certificate in order to establish a trust

If you want to generate a public key from the modulus/exponent combination for whatever else reason - you can do this using a suitable JSR223 Test Element and Groovy language, example code:

def modulus = new BigInteger('0086fa9ba066685845fc03833a9699c8baefb53cfbf19052a7f10f1eaa30488cec1ceb752bdff2df9fad6c64b3498956e7dbab4035b4823c99a44cc57088a23783', 16)
def exponent = new BigInteger('10001', 16)

def spec = new java.security.spec.RSAPublicKeySpec(modulus, exponent)
def factory = java.security.KeyFactory.getInstance('RSA')
def pub = factory.generatePublic(spec)

log.info('Public key: ' + pub.getEncoded().encodeBase64().toString())

enter image description here

Dmitri T
  • 159,985
  • 5
  • 83
  • 133