code: @SuppressWarnings("WeakerAccess")
      public PublicKey getPublicKey() throws InvalidPublicKeyException {
          if (!PUBLIC_KEY_ALGORITHM.equalsIgnoreCase(type)) {
              throw new InvalidPublicKeyException("The key is not of type RSA", null);
          }
          try {
              KeyFactory kf = KeyFactory.getInstance(PUBLIC_KEY_ALGORITHM);
              BigInteger modulus = new BigInteger(1, Base64.decodeBase64(stringValue("n")));
              BigInteger exponent = new BigInteger(1, Base64.decodeBase64(stringValue("e")));
              return kf.generatePublic(new RSAPublicKeySpec(modulus, exponent));
          } catch (InvalidKeySpecException e) {
              throw new InvalidPublicKeyException("Invalid public key", e);
          } catch (NoSuchAlgorithmException e) {
              throw new InvalidPublicKeyException("Invalid algorithm to generate key", e);
          }
      }
docs: Returns a {@link PublicKey} if the {@code 'alg'} is {@code 'RSA'}
  
  @return a public key
  @throws InvalidPublicKeyException if the key cannot be built or the key type is not RSA