/** * Get crypto codec for algorithm/mode/padding in config value * hadoop.security.crypto.cipher.suite * * @param conf * the configuration * @return CryptoCodec the codec object Null value will be returned if no * crypto codec classes with cipher suite configured. */ public static CryptoCodec getInstance(Configuration conf) { String name = conf.get(HADOOP_SECURITY_CRYPTO_CIPHER_SUITE_KEY, HADOOP_SECURITY_CRYPTO_CIPHER_SUITE_DEFAULT); return getInstance(conf, CipherSuite.convert(name)); }
final String srcArg, final FSPermissionChecker pc, final String cipher, final String keyName, final boolean logRetryCache) throws IOException { final CipherSuite suite = CipherSuite.convert(cipher); List<XAttr> xAttrs = Lists.newArrayListWithCapacity(1);
/** * Get crypto codec for algorithm/mode/padding in config value * hadoop.security.crypto.cipher.suite * * @param conf * the configuration * @return CryptoCodec the codec object Null value will be returned if no * crypto codec classes with cipher suite configured. */ public static CryptoCodec getInstance(Configuration conf) { String name = conf.get(HADOOP_SECURITY_CRYPTO_CIPHER_SUITE_KEY, HADOOP_SECURITY_CRYPTO_CIPHER_SUITE_DEFAULT); return getInstance(conf, CipherSuite.convert(name)); }
/** * Get crypto codec for algorithm/mode/padding in config value * hadoop.security.crypto.cipher.suite * * @param conf * the configuration * @return CryptoCodec the codec object Null value will be returned if no * crypto codec classes with cipher suite configured. */ public static CryptoCodec getInstance(Configuration conf) { String name = conf.get(HADOOP_SECURITY_CRYPTO_CIPHER_SUITE_KEY, HADOOP_SECURITY_CRYPTO_CIPHER_SUITE_DEFAULT); return getInstance(conf, CipherSuite.convert(name)); }
/** * Get crypto codec for algorithm/mode/padding in config value * hadoop.security.crypto.cipher.suite * * @param conf * the configuration * @return CryptoCodec the codec object Null value will be returned if no * crypto codec classes with cipher suite configured. */ public static CryptoCodec getInstance(Configuration conf) { String name = conf.get(HADOOP_SECURITY_CRYPTO_CIPHER_SUITE_KEY, HADOOP_SECURITY_CRYPTO_CIPHER_SUITE_DEFAULT); return getInstance(conf, CipherSuite.convert(name)); }
/** * Get crypto codec for algorithm/mode/padding in config value * hadoop.security.crypto.cipher.suite * * @param conf * the configuration * @return CryptoCodec the codec object Null value will be returned if no * crypto codec classes with cipher suite configured. */ public static CryptoCodec getInstance(Configuration conf) { String name = conf.get(HADOOP_SECURITY_CRYPTO_CIPHER_SUITE_KEY, HADOOP_SECURITY_CRYPTO_CIPHER_SUITE_DEFAULT); return getInstance(conf, CipherSuite.convert(name)); }
private void createEncryptionZoneInt(final String srcArg, String cipher, String keyName, final boolean logRetryCache) throws IOException { final String operationName = "createEncryptionZone"; String src = srcArg; HdfsFileStatus resultingStat = null; checkSuperuserPrivilege(); FSPermissionChecker pc = getPermissionChecker(); writeLock(); try { checkSuperuserPrivilege(); checkOperation(OperationCategory.WRITE); checkNameNodeSafeMode("Cannot create encryption zone on " + src); final INodesInPath iip = dir.resolvePathForWrite(pc, src); src = iip.getPath(); final CipherSuite suite = CipherSuite.convert(cipher); // For now this is hardcoded, as we only support one method. final CryptoProtocolVersion version = CryptoProtocolVersion.ENCRYPTION_ZONES; final XAttr ezXAttr = dir.createEncryptionZone(src, suite, version, keyName); List<XAttr> xAttrs = Lists.newArrayListWithCapacity(1); xAttrs.add(ezXAttr); getEditLog().logSetXAttrs(src, xAttrs, logRetryCache); resultingStat = dir.getAuditFileInfo(iip); } finally { writeUnlock(operationName); } getEditLog().logSync(); logAuditEvent(true, operationName, srcArg, null, resultingStat); }
private void createEncryptionZoneInt(final String srcArg, String cipher, String keyName, final boolean logRetryCache) throws IOException { final String operationName = "createEncryptionZone"; String src = srcArg; HdfsFileStatus resultingStat = null; checkSuperuserPrivilege(); FSPermissionChecker pc = getPermissionChecker(); writeLock(); try { checkSuperuserPrivilege(); checkOperation(OperationCategory.WRITE); checkNameNodeSafeMode("Cannot create encryption zone on " + src); final INodesInPath iip = dir.resolvePathForWrite(pc, src); src = iip.getPath(); final CipherSuite suite = CipherSuite.convert(cipher); // For now this is hardcoded, as we only support one method. final CryptoProtocolVersion version = CryptoProtocolVersion.ENCRYPTION_ZONES; final XAttr ezXAttr = dir.createEncryptionZone(src, suite, version, keyName); List<XAttr> xAttrs = Lists.newArrayListWithCapacity(1); xAttrs.add(ezXAttr); getEditLog().logSetXAttrs(src, xAttrs, logRetryCache); resultingStat = dir.getAuditFileInfo(iip); } finally { writeUnlock(operationName); } getEditLog().logSync(); logAuditEvent(true, operationName, srcArg, null, resultingStat); }