docs: private String wrap(Key key, String wrapAlgorithm) {
  
          try {
  
              Cipher cipher = Cipher.getInstance(wrapAlgorithm);
              cipher.init(Cipher.WRAP_MODE, wrapKey);
              byte[] wrappedKey = cipher.wrap(key);
              return ByteArray.toBase64(wrappedKey);
  
          } catch (NoSuchAlgorithmException e) {
              if (SecurityProvider.addProvider()) {
                  return wrap(key, wrapAlgorithm);
              } else {
                  throw new IllegalStateException("Algorithm unavailable: " + wrapAlgorithm, e);
              }
          } catch (NoSuchPaddingException e) {
              throw new IllegalStateException("Padding unavailable: " + wrapAlgorithm, e);
          } catch (InvalidKeyException e) {
              throw new IllegalArgumentException("Invalid key for " + wrapAlgorithm, e);
          } catch (IllegalBlockSizeException e) {
              throw new IllegalStateException("Error in block size for algorithm " + wrapAlgorithm, e);
          }
      }