edu.vt.middleware.crypt.pkcs
Enum PBES2Algorithm

java.lang.Object
  extended by java.lang.Enum<PBES2Algorithm>
      extended by edu.vt.middleware.crypt.pkcs.PBES2Algorithm
All Implemented Interfaces:
Serializable, Comparable<PBES2Algorithm>

public enum PBES2Algorithm
extends Enum<PBES2Algorithm>

Supported password-based encryption algorithms for PKCS#5 PBES2 encryption scheme. The ciphers mentioned in PKCS#5 are supported as well as others in common use or of presumed value.

Version:
$Revision: 1818 $
Author:
Middleware Services

Enum Constant Summary
AES128
          AES-128 CBC cipher.
AES192
          AES-192 CBC cipher.
AES256
          AES-256 CBC cipher.
DES
          DES CBC cipher.
DESede
          3-DES CBC cipher.
RC2
          RC2 CBC cipher.
RC5
          RC5 CBC cipher.
 
Method Summary
static PBES2Algorithm fromOid(String oid)
          Gets the PBE algorithm for the given object identifier.
 int getKeySize()
           
 String getOid()
           
 AlgorithmSpec getSpec()
           
static PBES2Algorithm valueOf(String name)
          Returns the enum constant of this type with the specified name.
static PBES2Algorithm[] values()
          Returns an array containing the constants of this enum type, in the order they are declared.
 
Methods inherited from class java.lang.Enum
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
 
Methods inherited from class java.lang.Object
getClass, notify, notifyAll, wait, wait, wait
 

Enum Constant Detail

DES

public static final PBES2Algorithm DES
DES CBC cipher.


DESede

public static final PBES2Algorithm DESede
3-DES CBC cipher.


RC2

public static final PBES2Algorithm RC2
RC2 CBC cipher.


RC5

public static final PBES2Algorithm RC5
RC5 CBC cipher.


AES128

public static final PBES2Algorithm AES128
AES-128 CBC cipher.


AES192

public static final PBES2Algorithm AES192
AES-192 CBC cipher.


AES256

public static final PBES2Algorithm AES256
AES-256 CBC cipher.

Method Detail

values

public static PBES2Algorithm[] values()
Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
for (PBES2Algorithm c : PBES2Algorithm.values())
    System.out.println(c);

Returns:
an array containing the constants of this enum type, in the order they are declared

valueOf

public static PBES2Algorithm valueOf(String name)
Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)

Parameters:
name - the name of the enum constant to be returned.
Returns:
the enum constant with the specified name
Throws:
IllegalArgumentException - if this enum type has no constant with the specified name
NullPointerException - if the argument is null

fromOid

public static PBES2Algorithm fromOid(String oid)
Gets the PBE algorithm for the given object identifier.

Parameters:
oid - PBE algorithm OID.
Returns:
Algorithm whose identifier equals given value.
Throws:
IllegalArgumentException - If no matching algorithm found.

getOid

public String getOid()
Returns:
the oid

getSpec

public AlgorithmSpec getSpec()
Returns:
Cipher algorithm specification.

getKeySize

public int getKeySize()
Returns:
Size of derived key in bits or -1 if algorithm does not define a key size.


Copyright © 2003-2011 Virginia Tech. All Rights Reserved.