@Override
    public void createKey(String keyName, int bitLength)
      throws IOException, NoSuchAlgorithmException {

      checkKeyProvider();

      if (keyProvider.getMetadata(keyName) == null) {
        final KeyProvider.Options options = new Options(this.conf);
        options.setCipher(HDFS_SECURITY_DEFAULT_CIPHER);
        options.setBitLength(bitLength);
        keyProvider.createKey(keyName, options);
        keyProvider.flush();
      } else {
        throw new IOException("key '" + keyName + "' already exists");
      }
    }
Compares two encryption key strengths.

@param path1 First  path to compare
@param path2 Second path to compare
@param encryptionShim2 The encryption-shim corresponding to path2.
@return 1 if path1 is stronger; 0 if paths are equals; -1 if path1 is weaker.
@throws IOException If an error occurred attempting to get key metadata
shims/0.23/src/main/java/org/apache/hadoop/hive/shims/Hadoop23Shims.java