com.quartzdesk.api.web.security.SecurityTokenCipherAlgorithm Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quartzdesk-api Show documentation
Show all versions of quartzdesk-api Show documentation
QuartzDesk Public API library required for QuartzDesk Standard and Enterprise edition installations. This library must be placed on the classpath of the Quartz scheduler based application that is managed by QuartzDesk. It is important that this library is loaded by the same classloader that loads the Quartz scheduler API used by the application.
/*
* Copyright (c) 2013-2019 QuartzDesk.com. All Rights Reserved.
* QuartzDesk.com PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
*/
package com.quartzdesk.api.web.security;
/**
* Enumeration representing supported symmetric cipher algorithms.
*
* @version $Id:$
*/
public enum SecurityTokenCipherAlgorithm
{
/**
* AES_128 enum item.
*/
AES_128( "AES/CBC/PKCS5Padding", "AES" ),
/**
* AES_192 enum item.
*/
AES_192( "AES/CBC/PKCS5Padding", "AES" ),
/**
* AES_256 enum item.
*/
AES_256( "AES/CBC/PKCS5Padding", "AES" ),
/**
* DES_56 enum item.
*/
DES_56( "DES/CBC/PKCS5Padding", "DES" ),
/**
* TRIPPLE_DES_192 enum item.
*/
TRIPPLE_DES_192( "DESede/CBC/PKCS5Padding", "DESede" ),
/**
* BLOWFISH_256 enum item.
*/
BLOWFISH_256( "Blowfish/CBC/PKCS5Padding", "Blowfish" );
/**
* The cipher key algorithm value.
*/
private final String keyAlg;
/**
* The cipher transformation value.
*/
private final String transformation;
/**
* Creates a new SymmetricCipherAlgorithm enum item with the specified value.
*
* @param transformation a transformation that is used to obtain a {@link javax.crypto.Cipher} instance.
*/
SecurityTokenCipherAlgorithm( String transformation, String keyAlg ) // always private, no need to explicitly tell
{
this.transformation = transformation;
this.keyAlg = keyAlg;
}
public String getKeyAlgorithm()
{
return keyAlg;
}
public String getName()
{
return name();
}
public int getOrdinal()
{
return ordinal();
}
public String getTransformation()
{
return transformation;
}
//
//
// /**
// * Returns the enum item with the specified value.
// *
// * @param value a value.
// * @return the enum item with the specified value.
// */
// public static SymmetricCipherAlgorithm fromValue( String value )
// {
// SymmetricCipherAlgorithm[] items = SymmetricCipherAlgorithm.values();
// for ( SymmetricCipherAlgorithm item : items )
// {
// if ( value.equals( item.getValue() ) )
// return item;
// }
// throw new IllegalArgumentException(
// "No item with value: " + value + " defined in enum: " + SymmetricCipherAlgorithm.class.getSimpleName() );
// }
}