Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * =============================================================================
   * 
   *   Copyright (c) 2007, The JASYPT team (http://www.jasypt.org)
   * 
   *   Licensed under the Apache License, Version 2.0 (the "License");
   *   you may not use this file except in compliance with the License.
   *   You may obtain a copy of the License at
   * 
  *       http://www.apache.org/licenses/LICENSE-2.0
  * 
  *   Unless required by applicable law or agreed to in writing, software
  *   distributed under the License is distributed on an "AS IS" BASIS,
  *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  *   See the License for the specific language governing permissions and
  *   limitations under the License.
  * 
  * =============================================================================
  */
 package org.jasypt.encryption.pbe.config;
 
 

Bean implementation for PBEConfig. This class allows the values for the configuration parameters to be set via "standard" setX methods.

For any of the configuration parameters, if its setX method is not called, a null value will be returned by the corresponding getX method.

Author(s):
Daniel Fernández Garrido
Since:
1.0
 
 public class SimplePBEConfig implements PBEConfig {
     
     private String algorithm = null;
     private String password = null;
     private Integer keyObtentionIterations = null;
     private SaltGenerator saltGenerator = null;
     private String providerName = null;
     private Provider provider = null;


    

Creates a new SimplePBEConfig instance.

 
     public SimplePBEConfig() {
         super();
     }

    
    

Sets a value for the encryption algorithm

This algorithm has to be supported by your JCE provider and, if this provider supports it, you can also specify mode and padding for it, like ALGORITHM/MODE/PADDING.

Parameters:
algorithm the name of the algorithm to be used
 
     public void setAlgorithm(String algorithm) {
         this. = algorithm;
     }


    
Sets the password to be used for encryption.

Parameters:
password the password to be used.
 
     public void setPassword(String password) {
         this. = password;
     }

    
    
Sets the number of hashing iterations applied to obtain the encryption key.

Parameters:
keyObtentionIterations the number of iterations.
 
     public void setKeyObtentionIterations(Integer keyObtentionIterations) {
         this. = keyObtentionIterations;
     }
    
    

Sets the salt generator.

If not set, null will returned.

Parameters:
saltGenerator the salt generator.
    public void setSaltGenerator(SaltGenerator saltGenerator) {
        this. = saltGenerator;
    }
    
    

Sets the name of the security provider to be asked for the encryption algorithm. This provider should be already registered.

If both the providerName and provider properties are set, only provider will be used, and providerName will have no meaning for the encryptor object.

If not set, null will be returned.

Parameters:
providerName the name of the security provider.
Since:
1.3
    public void setProviderName(String providerName) {
        this. = providerName;
    }
    
    

Sets the security provider to be used for obtaining the encryption algorithm. This method is an alternative to setProviderName(java.lang.String) and they should not be used altogether. The provider specified with setProvider(java.security.Provider) does not have to be registered beforehand, and its use will not result in its being registered.

If both the providerName and provider properties are set, only provider will be used, and providerName will have no meaning for the encryptor object.

If not set, null will be returned.

Parameters:
provider the security provider object.
Since:
1.3
    public void setProvider(Provider provider) {
        this. = provider;
    }
    
    public String getAlgorithm() {
        return this.;
    }
    
    public String getPassword() {
        return this.;
    }
    
        return this.;
    }
    
    
    public SaltGenerator getSaltGenerator() {
        return this.;
    }
    
    public String getProviderName() {
        return this.;
    }
    
    public Provider getProvider() {
        return this.;
    }
    
New to GrepCode? Check out our FAQ X