Java Code Examples for org.apache.hadoop.crypto.CryptoProtocolVersion#supports()

The following examples show how to use org.apache.hadoop.crypto.CryptoProtocolVersion#supports() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: OzoneKMSUtil.java    From hadoop-ozone with Apache License 2.0 5 votes vote down vote up
public static CryptoProtocolVersion getCryptoProtocolVersion(
    FileEncryptionInfo feInfo) throws IOException {
  CryptoProtocolVersion version = feInfo.getCryptoProtocolVersion();
  if (!CryptoProtocolVersion.supports(version)) {
    throw new IOException("Client does not support specified " +
            "CryptoProtocolVersion " + version.getDescription() +
            " version number" + version.getVersion());
  } else {
    return version;
  }
}
 
Example 2
Source File: OzoneKMSUtil.java    From hadoop-ozone with Apache License 2.0 5 votes vote down vote up
public static void checkCryptoProtocolVersion(
        FileEncryptionInfo feInfo) throws IOException {
  CryptoProtocolVersion version = feInfo.getCryptoProtocolVersion();
  if (!CryptoProtocolVersion.supports(version)) {
    throw new IOException("Client does not support specified " +
            "CryptoProtocolVersion " + version.getDescription() +
            " version number" + version.getVersion());
  }
}
 
Example 3
Source File: DFSClient.java    From hadoop with Apache License 2.0 5 votes vote down vote up
/**
 * Obtain the crypto protocol version from the provided FileEncryptionInfo,
 * checking to see if this version is supported by.
 *
 * @param feInfo FileEncryptionInfo
 * @return CryptoProtocolVersion from the feInfo
 * @throws IOException if the protocol version is unsupported.
 */
private static CryptoProtocolVersion getCryptoProtocolVersion
    (FileEncryptionInfo feInfo) throws IOException {
  final CryptoProtocolVersion version = feInfo.getCryptoProtocolVersion();
  if (!CryptoProtocolVersion.supports(version)) {
    throw new IOException("Client does not support specified " +
        "CryptoProtocolVersion " + version.getDescription() + " version " +
        "number" + version.getVersion());
  }
  return version;
}
 
Example 4
Source File: DFSClient.java    From big-c with Apache License 2.0 5 votes vote down vote up
/**
 * Obtain the crypto protocol version from the provided FileEncryptionInfo,
 * checking to see if this version is supported by.
 *
 * @param feInfo FileEncryptionInfo
 * @return CryptoProtocolVersion from the feInfo
 * @throws IOException if the protocol version is unsupported.
 */
private static CryptoProtocolVersion getCryptoProtocolVersion
    (FileEncryptionInfo feInfo) throws IOException {
  final CryptoProtocolVersion version = feInfo.getCryptoProtocolVersion();
  if (!CryptoProtocolVersion.supports(version)) {
    throw new IOException("Client does not support specified " +
        "CryptoProtocolVersion " + version.getDescription() + " version " +
        "number" + version.getVersion());
  }
  return version;
}
 
Example 5
Source File: ProxiedDFSClient.java    From spliceengine with GNU Affero General Public License v3.0 5 votes vote down vote up
/**
 * Obtain the crypto protocol version from the provided FileEncryptionInfo,
 * checking to see if this version is supported by.
 *
 * @param feInfo FileEncryptionInfo
 * @return CryptoProtocolVersion from the feInfo
 * @throws IOException if the protocol version is unsupported.
 */
private static CryptoProtocolVersion getCryptoProtocolVersion
(FileEncryptionInfo feInfo) throws IOException {
    final CryptoProtocolVersion version = feInfo.getCryptoProtocolVersion();
    if (!CryptoProtocolVersion.supports(version)) {
        throw new IOException("Client does not support specified " +
                "CryptoProtocolVersion " + version.getDescription() + " version " +
                "number" + version.getVersion());
    }
    return version;
}