code: public static EncryptionProvider getProvider(final Key key) throws UnsupportedAlgorithmException, UnsupportedKeySizeException {
  
  		String algorithm = key.getAlgorithm();
  
  		SupportedKeyGenAlgorithms keyAlgorithm = getAlgorithm(algorithm);
  
  		switch (keyAlgorithm) {
  		case AES:
  			return new AESEncryptionProvider(key);
  			
  		case DES:
  			return new DESEdeEncryptionProvider(key);
  			
  		default:
  			throw new UnsupportedAlgorithmException("Algorithm [" + keyAlgorithm + "] is not supported.");
  		}
  
  	}
docs: Method which will return a new instance of {@link EncryptionProvider}
  based on the settings of the key passed in.
  
  @param key
  @return
  @return
  @throws UnsupportedAlgorithmException
  @throws UnsupportedKeySizeException