code: protected byte[] EMSA_PKCS1_V1_5_ENCODE_HASH(byte[] h, int emLen, String algorithm) throws NoSuchAlgorithmException {
  
          // Check m
          if (h == null || h.length == 0) {
              throw new IllegalArgumentException("m");
          }
  
          byte[] algorithmPrefix = null;
  
          // Check algorithm
          if (Strings.isNullOrWhiteSpace(algorithm)) {
              throw new IllegalArgumentException("algorithm");
          }
  
          // Only supported algorithms
          if (algorithm.equals("SHA-256")) {
  
              // Initialize prefix and digest
              algorithmPrefix = SHA_256_PREFIX;
  
              if (h.length != 32) {
                  throw new IllegalArgumentException("h is incorrect length for SHA-256");
              }
          } else {
              throw new IllegalArgumentException("algorithm");
          }
  
  
          // Construct t, the DER encoded DigestInfo structure
          byte[] t = new byte[algorithmPrefix.length + h.length];
  
          System.arraycopy(algorithmPrefix, 0, t, 0, algorithmPrefix.length);
          System.arraycopy(h, 0, t, algorithmPrefix.length, h.length);
  
          if (emLen < t.length + 11) {
              throw new IllegalArgumentException("intended encoded message length too short");
          }
  
          // Construct ps
          byte[] ps = new byte[emLen - t.length - 3];
  
          for (int i = 0; i < ps.length; i++) {
              ps[i] = (byte) 0xff;
          }
  
          // Construct em
          byte[] em = new byte[ps.length + t.length + 3];
  
          em[0] = 0x00; em[1] = 0x01; em[ps.length + 2] = 0x00;
  
          System.arraycopy(ps, 0, em, 2, ps.length);
          System.arraycopy(t, 0, em, ps.length + 3, t.length);
  
          return em;
      }
docs: /*
  See https://tools.ietf.org/html/rfc3447#section-9.2