code: static RSAPublicKey from(final byte[] key)
        throws InvalidKeyException, NoSuchAlgorithmException, InvalidKeySpecException {
  
      final String s = new String(key);
      final byte[] encoded;
      final String decoded;
      if (s.startsWith(RSA_LABEL)) {
        decoded = s.split(" ")[1];
        encoded = Base64.decodeBase64(decoded);
      } else {
        encoded = key;
        decoded = Base64.encodeBase64String(key);
      }
  
      final Iterator<byte[]> fields = new ByteIterator(encoded);
      final String sigType = new String(fields.next());
      if (!sigType.equals(RSA_LABEL)) {
        throw new RuntimeException(String.format(
            "Unknown key type %s. This code currently only supports %s.", sigType, RSA_LABEL));
      }
  
      final RSAPublicKeySpec keySpec =
          TraditionalKeyParser.parsePemPublicKey(RSA_LABEL + " " + decoded + " ");
      final KeyFactory keyFactory = KeyFactory.getInstance("Rsa");
      return (RSAPublicKey) keyFactory.generatePublic(keySpec);
    }
docs: Create an {@link RSAPublicKey} from bytes.
  @param key Array of bytes representing Rsa public key.
  @return {@link RSAPublicKey}