Package org.apache.orc.impl
Interface KeyProvider
public interface KeyProvider
A source of crypto keys. This is usually backed by a Ranger KMS.
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic interface
A service loader factory interface. -
Method Summary
Modifier and TypeMethodDescriptionCreate a local key for the given key version.decryptLocalKey
(HadoopShims.KeyMetadata key, byte[] encryptedKey) Decrypt a local key for reading a file.getCurrentKeyVersion
(String keyName) Get the current metadata for a given key.Get the list of key names from the key provider.getKind()
Get the kind of this provider.
-
Method Details
-
getKeyNames
Get the list of key names from the key provider.- Returns:
- a list of key names
- Throws:
IOException
-
getCurrentKeyVersion
Get the current metadata for a given key. This is used when encrypting new data.- Parameters:
keyName
- the name of a key- Returns:
- metadata for the current version of the key
- Throws:
IllegalArgumentException
- if the key is unknownIOException
-
createLocalKey
Create a local key for the given key version. This local key will be randomly generated and encrypted with the given version of the master key. The encryption and decryption is done with the local key and the user process never has access to the master key, because it stays on the Ranger KMS.- Parameters:
key
- the master key version- Returns:
- the local key's material both encrypted and unencrypted
- Throws:
IOException
-
decryptLocalKey
Decrypt a local key for reading a file.- Parameters:
key
- the master key versionencryptedKey
- the encrypted key- Returns:
- the decrypted local key's material or null if the key is not available
- Throws:
IOException
-
getKind
HadoopShims.KeyProviderKind getKind()Get the kind of this provider.
-