Encrypting a Rest JSON message with a public key

77 Views Asked by At

In Java (gradle) I need to encrypt JSON rest messages with the public key extracted from a TLS-2way certificate.pem. Like this:

Load RSA PKCS#1 Public Keys
pkcs1PublicKey: Sun RSA public key, 2048 bits
  params: null
  modulus: 30333480050529072539152474433261825229175303911986187056546130987160889422922632165228273249976997833741424393377152058709551313162877595353675051556949998681388601725684016724167050111037861889500002806879899578986908702627237884089998121288607696752162223715667435607286689842713475938751449494999920670300421827737208147069624343973533326291094315256948284968840679921633097541211738122424891429452073949806872319418453594822983237338545978675594260211082913078702997218079517998196340177653632261614031770091082266225991043014081642881957716572923856737534043425399435601282335538921977379429228634484095086075971
  public exponent: 65537

I know how to do it with a generated key pair, but I need to use this type of public key. Thanks in advance for your help.

WJ

0

There are 0 best solutions below