CryptoUtils (ORC Core 1.6.6 API)
Date: 2021-01-13

org.apache.orc.impl

## Class CryptoUtils

- java.lang.Object
- - org.apache.orc.impl.CryptoUtils

-     public class CryptoUtils
      extends Object

  This class has routines to work with encryption within ORC files.

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static class` | `CryptoUtils.HadoopKeyProviderFactory`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CryptoUtils()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `clearCounter(byte[] iv)` Clear the counter part of the IV.
    `static KeyProvider` | `getKeyProvider(Configuration conf, Random random)` Create a KeyProvider.
    `static Consumer<byte[]>` | `modifyIvForStream(int columnId, OrcProto.Stream.Kind kind, long stripeId)` Update the unique IV for each stream within a single key.
    `static Consumer<byte[]>` | `modifyIvForStream(StreamName name, long stripeId)` Update the unique IV for each stream within a single key.
    `static Consumer<byte[]>` | `modifyIvForStripe(long stripeId)` Modify the IV for the given stripe id and make sure the low bytes are set to 0.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### CryptoUtils

          public CryptoUtils()

  - ### Method Detail

    - #### modifyIvForStream

          public static Consumer<byte[]> modifyIvForStream(StreamName name,
                                                           long stripeId)

      Update the unique IV for each stream within a single key. The top bytes are set with the column, stream kind, and stripe id and the lower 8 bytes are always 0.
      Parameters:
        `name` - the stream name
        `stripeId` - the stripe id

    - #### modifyIvForStream

          public static Consumer<byte[]> modifyIvForStream(int columnId,
                                                           OrcProto.Stream.Kind kind,
                                                           long stripeId)

      Update the unique IV for each stream within a single key. The top bytes are set with the column, stream kind, and stripe id and the lower 8 bytes are always 0.
      Parameters:
        `columnId` - the column id
        `kind` - the stream kind
        `stripeId` - the stripe id

    - #### modifyIvForStripe

          public static Consumer<byte[]> modifyIvForStripe(long stripeId)

      Modify the IV for the given stripe id and make sure the low bytes are set to 0.
      Parameters:
        `stripeId` - the stripe id

    - #### clearCounter

          public static void clearCounter(byte[] iv)

      Clear the counter part of the IV.
      Parameters:
        `iv` - the IV to modify

    - #### getKeyProvider

          public static KeyProvider getKeyProvider(Configuration conf,
                                                   Random random)
                                            throws IOException

      Create a KeyProvider. It will cache the result, so that only one provider of each kind will be created.
      Parameters:
        `random` - the random generator to use
      Returns:
        the new KeyProvider
      Throws:
        `IOException`

Copyright © 2013–2021 The Apache Software Foundation. All rights reserved.