docs: public PrivateKey bytesToPrivateKey(byte[] pemKey) throws CryptoException {
          PrivateKey pk = null;
          CryptoException ce = null;
  
          try {
              PemReader pr = new PemReader(new StringReader(new String(pemKey)));
              PemObject po = pr.readPemObject();
              PEMParser pem = new PEMParser(new StringReader(new String(pemKey)));
  
              if (po.getType().equals("PRIVATE KEY")) {
                  pk = new JcaPEMKeyConverter().getPrivateKey((PrivateKeyInfo) pem.readObject());
              } else {
                  logger.trace("Found private key with type " + po.getType());
                  PEMKeyPair kp = (PEMKeyPair) pem.readObject();
                  pk = new JcaPEMKeyConverter().getPrivateKey(kp.getPrivateKeyInfo());
              }
          } catch (Exception e) {
              throw new CryptoException("Failed to convert private key bytes", e);
          }
          return pk;
      }