java/shims/src/java/org/apache/orc/impl/HadoopShimsPre2_7.java
static EncryptionAlgorithm findAlgorithm(KeyProviderCryptoExtension.Metadata meta) {
      String cipher = meta.getCipher();
      if (cipher.startsWith("AES/")) {
        int bitLength = meta.getBitLength();
        if (bitLength == 128) {
          return EncryptionAlgorithm.AES_128;
        } else {
          if (bitLength != 256) {
            LOG.info("ORC column encryption does not support " + bitLength +
                " bit keys. Using 256 bits instead.");
          }
          return EncryptionAlgorithm.AES_256;
        }
      }
      throw new IllegalArgumentException("ORC column encryption only supports" +
          " AES and not " + cipher);
    }
/**
     * Find the correct algorithm based on the key's metadata.
     * @param meta the key's metadata
     * @return the correct algorithm
     */
Find the correct algorithm based on the key's metadata.
@param meta the key's metadata
@return the correct algorithm
Find the correct algorithm based on the key ' s metadata . @param meta the key ' s metadata @return the correct algorithm
static EncryptionAlgorithm findAlgorithm(KeyProviderCryptoExtension.Metadata meta) {
      String cipher = meta.getCipher();
      if (cipher.startsWith("AES/")) {
        int bitLength = meta.getBitLength();
        if (bitLength == 128) {
          return EncryptionAlgorithm.AES_128;
        } else {
          if (bitLength != 256) {
            LOG.info("ORC column encryption does not support " + bitLength +
                " bit keys. Using 256 bits instead.");
          }
          return EncryptionAlgorithm.AES_256;
        }
      }
      throw new IllegalArgumentException("ORC column encryption only supports" +
          " AES and not " + cipher);
    }
static EncryptionAlgorithm findAlgorithm ( KeyProviderCryptoExtension . Metadata meta ) { String cipher = meta . getCipher ( ) ; if ( cipher . startsWith ( "AES/" ) ) { int bitLength = meta . getBitLength ( ) ; if ( bitLength == 128 ) { return EncryptionAlgorithm . AES_128 ; } else { if ( bitLength != 256 ) { LOG . info ( "ORC column encryption does not support " + bitLength + " bit keys. Using 256 bits instead." ) ; } return EncryptionAlgorithm . AES_256 ; } } throw new IllegalArgumentException ( "ORC column encryption only supports" + " AES and not " + cipher ) ; }
Find the correct algorithm based on the key's metadata.
Find the correct algorithm based on the key ' s metadata .