code: protected byte[] EMSA_PKCS1_V1_5_ENCODE(byte[] m, int emLen, String algorithm) throws NoSuchAlgorithmException {
  
          // Check m
          if (m == null || m.length == 0) {
              throw new IllegalArgumentException("m");
          }
  
          MessageDigest messageDigest   = null;
  
          // Check algorithm
          if (Strings.isNullOrWhiteSpace(algorithm)) {
              throw new IllegalArgumentException("algorithm");
          }
  
          // Only supported algorithms
          if (algorithm.equals("SHA-256")) {
  
              // Initialize digest
              messageDigest   = MessageDigest.getInstance("SHA-256");
          } else {
              throw new IllegalArgumentException("algorithm");
          }
  
          // Hash the message
          byte[] digest = messageDigest.digest(m);
  
          // Construct T, the DER encoded DigestInfo structure
          return EMSA_PKCS1_V1_5_ENCODE_HASH(digest, emLen, algorithm);
      }
docs: /*
  See https://tools.ietf.org/html/rfc3447#section-9.2