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.digest.config;
 
 

Bean implementation for DigesterConfig. 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 SimpleDigesterConfig implements DigesterConfig {
     
     private String algorithm = null;
     private Integer iterations = null;
     private Integer saltSizeBytes = null;
     private SaltGenerator saltGenerator = null;
     private String providerName = null;
     private Provider provider = null;
    

    

Creates a new SimpleDigesterConfig instance.

 
     public SimpleDigesterConfig() {
         super();
     }
    
    

Sets the name of the algorithm.

This algorithm has to be supported by your security infrastructure, and it should be allowed as an algorithm for creating java.security.MessageDigest instances.

If you are specifying a security provider with setProvider(java.security.Provider) or setProviderName(java.lang.String), this algorithm should be supported by your specified provider.

If you are not specifying a provider, you will be able to use those algorithms provided by the default security provider of your JVM vendor. For valid names in the Sun JVM, see Java Cryptography Architecture API Specification & Reference.

If not set, null will be returned.

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

    
    

Sets the number of hashing iterations.

If not set, null will be returned.

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

    
    

Size in bytes of the salt to be used.

If not set, null will be returned.

Parameters:
saltSizeBytes the size of the salt, in bytes.
    public void setSaltSizeBytes(Integer saltSizeBytes) {
        this. = saltSizeBytes;
    }

    
    

Sets the salt generator.

If not set, null will be returned.

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

Sets the name of the security provider to be asked for the digest 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 digester 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 digest 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 digester 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 Integer getIterations() {
        return this.;
    }
    
    public Integer getSaltSizeBytes() {
        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