• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java SymmetricCrypto类的典型用法和代码示例

java 2次浏览

本文整理汇总了Java中org.pentaho.di.trans.steps.symmetriccrypto.symmetricalgorithm.SymmetricCrypto的典型用法代码示例。如果您正苦于以下问题:Java SymmetricCrypto类的具体用法?Java SymmetricCrypto怎么用?Java SymmetricCrypto使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。

SymmetricCrypto类属于org.pentaho.di.trans.steps.symmetriccrypto.symmetricalgorithm包,在下文中一共展示了SymmetricCrypto类的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: init

点赞 3

import org.pentaho.di.trans.steps.symmetriccrypto.symmetricalgorithm.SymmetricCrypto; //导入依赖的package包/类
public boolean init(StepMetaInterface smi, StepDataInterface sdi)
{
	meta=(SymmetricCryptoTransMeta)smi;
	data=(SymmetricCryptoTransData)sdi;		
	if (super.init(smi, sdi)) {
	    // Add init code here.
		
		try {
			// Define a new instance
			data.CryptMeta=new SymmetricCryptoMeta(meta.getAlgorithm());
			// Initialize a new crypto trans object
			data.Crypt = new SymmetricCrypto(data.CryptMeta, environmentSubstitute(meta.getSchema()));

		}catch(Exception e) {
			logError(BaseMessages.getString(PKG, "SymmetricCryptoTrans.ErrorInit."), e);
			return false;
		}
		
	    return true;
	}
	return false;
}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:23,
代码来源:SymmetricCryptoTrans.java

示例2: init

点赞 3

import org.pentaho.di.trans.steps.symmetriccrypto.symmetricalgorithm.SymmetricCrypto; //导入依赖的package包/类
public boolean init( StepMetaInterface smi, StepDataInterface sdi ) {
  meta = (SymmetricCryptoTransMeta) smi;
  data = (SymmetricCryptoTransData) sdi;
  if ( super.init( smi, sdi ) ) {
    // Add init code here.

    try {
      // Define a new instance
      data.CryptMeta = new SymmetricCryptoMeta( meta.getAlgorithm() );
      // Initialize a new crypto trans object
      data.Crypt = new SymmetricCrypto( data.CryptMeta, environmentSubstitute( meta.getSchema() ) );

    } catch ( Exception e ) {
      logError( BaseMessages.getString( PKG, "SymmetricCryptoTrans.ErrorInit." ), e );
      return false;
    }

    return true;
  }
  return false;
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:22,
代码来源:SymmetricCryptoTrans.java

示例3: init

点赞 2

import org.pentaho.di.trans.steps.symmetriccrypto.symmetricalgorithm.SymmetricCrypto; //导入依赖的package包/类
public boolean init(StepMetaInterface smi, StepDataInterface sdi) {
	meta = (SecretKeyGeneratorMeta) smi;
	data = (SecretKeyGeneratorData) sdi;

	if (super.init(smi, sdi)) {
		// Add init code here.
		
		if(Const.isEmpty(meta.getAlgorithm())) {
			logError(BaseMessages.getString(PKG, "SecretKeyGenerator.Log.NoFieldSpecified"));
			return false;
		}	
		
		if(Const.isEmpty(meta.getSecretKeyFieldName())) {
			logError(BaseMessages.getString(PKG, "SecretKeyGenerator.Log.secretKeyFieldMissing"));
			return false;
		}
		
		data.nr= meta.getAlgorithm().length;
		data.algorithm = new int[data.nr];
		data.scheme = new String[data.nr];
		data.secretKeyLen = new int[data.nr];
		data.secretKeyCount = new int[data.nr];
		
		for(int i=0; i<data.nr; i++) {
			data.algorithm[i] = SymmetricCryptoMeta.getAlgorithmTypeFromCode(meta.getAlgorithm()[i]);
			String len= environmentSubstitute(meta.getSecretKeyLength()[i]);
			data.secretKeyLen[i] = Const.toInt(len, -1);
			if(data.secretKeyLen[i]<0) {
				logError(BaseMessages.getString(PKG, "SecretKeyGenerator.Log.WrongLength", len, String.valueOf(i)));
				return false;
			}
			String size= environmentSubstitute(meta.getSecretKeyCount()[i]);
			data.secretKeyCount[i] = Const.toInt(size, -1);
			if(data.secretKeyCount[i]<0) {
				logError(BaseMessages.getString(PKG, "SecretKeyGenerator.Log.WrongSize", size, String.valueOf(i)));
				return false;
			}
			data.scheme[i] = environmentSubstitute(meta.getScheme()[i]);
		}

		data.readsRows = getStepMeta().getRemoteInputSteps().size()>0;
        List<StepMeta> previous = getTransMeta().findPreviousSteps(getStepMeta());
		if (previous!=null && previous.size()>0) {
			data.readsRows = true;
		}
		
		
		data.addAlgorithmOutput= !Const.isEmpty(meta.getAlgorithmFieldName());
		data.addSecretKeyLengthOutput= !Const.isEmpty(meta.getSecretKeyLengthFieldName());

		data.cryptoTrans = new SymmetricCrypto[data.nr];
		for(int i=0; i< data.nr; i++) {
			try {
				// Define a new cryptotrans meta instance
				SymmetricCryptoMeta cryptoTransMeta=new SymmetricCryptoMeta(meta.getAlgorithm()[i]);
				
				// Initialize a new cryptotrans object
				data.cryptoTrans[i] = new SymmetricCrypto(cryptoTransMeta, data.scheme[i]);

			}catch(Exception e) {
				logError(BaseMessages.getString(PKG, "SecretKey.Init.Error"), e);
				return false;
			}
		}
		
		return true;
	}
	return false;
}
 

开发者ID:yintaoxue,
项目名称:read-open-source-code,
代码行数:70,
代码来源:SecretKeyGenerator.java

示例4: init

点赞 2

import org.pentaho.di.trans.steps.symmetriccrypto.symmetricalgorithm.SymmetricCrypto; //导入依赖的package包/类
public boolean init( StepMetaInterface smi, StepDataInterface sdi ) {
  meta = (SecretKeyGeneratorMeta) smi;
  data = (SecretKeyGeneratorData) sdi;

  if ( super.init( smi, sdi ) ) {
    // Add init code here.

    if ( Utils.isEmpty( meta.getAlgorithm() ) ) {
      logError( BaseMessages.getString( PKG, "SecretKeyGenerator.Log.NoFieldSpecified" ) );
      return false;
    }

    if ( Utils.isEmpty( meta.getSecretKeyFieldName() ) ) {
      logError( BaseMessages.getString( PKG, "SecretKeyGenerator.Log.secretKeyFieldMissing" ) );
      return false;
    }

    data.nr = meta.getAlgorithm().length;
    data.algorithm = new int[data.nr];
    data.scheme = new String[data.nr];
    data.secretKeyLen = new int[data.nr];
    data.secretKeyCount = new int[data.nr];

    for ( int i = 0; i < data.nr; i++ ) {
      data.algorithm[i] = SymmetricCryptoMeta.getAlgorithmTypeFromCode( meta.getAlgorithm()[i] );
      String len = environmentSubstitute( meta.getSecretKeyLength()[i] );
      data.secretKeyLen[i] = Const.toInt( len, -1 );
      if ( data.secretKeyLen[i] < 0 ) {
        logError( BaseMessages.getString( PKG, "SecretKeyGenerator.Log.WrongLength", len, String.valueOf( i ) ) );
        return false;
      }
      String size = environmentSubstitute( meta.getSecretKeyCount()[i] );
      data.secretKeyCount[i] = Const.toInt( size, -1 );
      if ( data.secretKeyCount[i] < 0 ) {
        logError( BaseMessages.getString( PKG, "SecretKeyGenerator.Log.WrongSize", size, String.valueOf( i ) ) );
        return false;
      }
      data.scheme[i] = environmentSubstitute( meta.getScheme()[i] );
    }

    data.readsRows = getStepMeta().getRemoteInputSteps().size() > 0;
    List<StepMeta> previous = getTransMeta().findPreviousSteps( getStepMeta() );
    if ( previous != null && previous.size() > 0 ) {
      data.readsRows = true;
    }

    data.addAlgorithmOutput = !Utils.isEmpty( meta.getAlgorithmFieldName() );
    data.addSecretKeyLengthOutput = !Utils.isEmpty( meta.getSecretKeyLengthFieldName() );

    data.cryptoTrans = new SymmetricCrypto[data.nr];
    for ( int i = 0; i < data.nr; i++ ) {
      try {
        // Define a new cryptotrans meta instance
        SymmetricCryptoMeta cryptoTransMeta = new SymmetricCryptoMeta( meta.getAlgorithm()[i] );

        // Initialize a new cryptotrans object
        data.cryptoTrans[i] = new SymmetricCrypto( cryptoTransMeta, data.scheme[i] );

      } catch ( Exception e ) {
        logError( BaseMessages.getString( PKG, "SecretKey.Init.Error" ), e );
        return false;
      }
    }

    return true;
  }
  return false;
}
 

开发者ID:pentaho,
项目名称:pentaho-kettle,
代码行数:69,
代码来源:SecretKeyGenerator.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)