APIdia Launch Partner
Top Description Inners Fields Constructors Methods
com.sun.crypto.provider

pack-priv abstract Class PBES2Parameters

extends AlgorithmParametersSpi
Class Inheritance
Known Direct Subclasses
com.sun.crypto.provider.PBES2Parameters.General, com.sun.crypto.provider.PBES2Parameters.HmacSHA1AndAES_128, com.sun.crypto.provider.PBES2Parameters.HmacSHA224AndAES_128, com.sun.crypto.provider.PBES2Parameters.HmacSHA256AndAES_128, com.sun.crypto.provider.PBES2Parameters.HmacSHA384AndAES_128, com.sun.crypto.provider.PBES2Parameters.HmacSHA512AndAES_128, com.sun.crypto.provider.PBES2Parameters.HmacSHA512_224AndAES_128, com.sun.crypto.provider.PBES2Parameters.HmacSHA512_256AndAES_128, com.sun.crypto.provider.PBES2Parameters.HmacSHA1AndAES_256, com.sun.crypto.provider.PBES2Parameters.HmacSHA224AndAES_256, com.sun.crypto.provider.PBES2Parameters.HmacSHA256AndAES_256, com.sun.crypto.provider.PBES2Parameters.HmacSHA384AndAES_256, com.sun.crypto.provider.PBES2Parameters.HmacSHA512AndAES_256, com.sun.crypto.provider.PBES2Parameters.HmacSHA512_224AndAES_256, com.sun.crypto.provider.PBES2Parameters.HmacSHA512_256AndAES_256
Imports
java.io.*, java.security.NoSuchAlgorithmException, .AlgorithmParametersSpi, java.security.spec.AlgorithmParameterSpec, .InvalidParameterSpecException, javax.crypto.spec.IvParameterSpec, .PBEParameterSpec, sun.security.util.PBKDF2Parameters, sun.security.util.*

This class implements the parameter set used with password-based encryption scheme 2 (PBES2), which is defined in PKCS#5 as follows:
-- PBES2

PBES2Algorithms ALGORITHM-IDENTIFIER ::=
  { {PBES2-params IDENTIFIED BY id-PBES2}, ...}

id-PBES2 OBJECT IDENTIFIER ::= {pkcs-5 13}

PBES2-params ::= SEQUENCE {
  keyDerivationFunc AlgorithmIdentifier {{PBES2-KDFs}},
  encryptionScheme AlgorithmIdentifier {{PBES2-Encs}} }

PBES2-KDFs ALGORITHM-IDENTIFIER ::=
  { {PBKDF2-params IDENTIFIED BY id-PBKDF2}, ... }

PBES2-Encs ALGORITHM-IDENTIFIER ::= { ... }

-- PBKDF2

PBKDF2Algorithms ALGORITHM-IDENTIFIER ::=
  { {PBKDF2-params IDENTIFIED BY id-PBKDF2}, ...}

id-PBKDF2 OBJECT IDENTIFIER ::= {pkcs-5 12}

PBKDF2-params ::= SEQUENCE {
    salt CHOICE {
      specified OCTET STRING,
      otherSource AlgorithmIdentifier {{PBKDF2-SaltSources}}
    },
    iterationCount INTEGER (1..MAX),
    keyLength INTEGER (1..MAX) OPTIONAL,
    prf AlgorithmIdentifier {{PBKDF2-PRFs}} DEFAULT algid-hmacWithSHA1
}

PBKDF2-SaltSources ALGORITHM-IDENTIFIER ::= { ... }

PBKDF2-PRFs ALGORITHM-IDENTIFIER ::= {
    {NULL IDENTIFIED BY id-hmacWithSHA1} |
    {NULL IDENTIFIED BY id-hmacWithSHA224} |
    {NULL IDENTIFIED BY id-hmacWithSHA256} |
    {NULL IDENTIFIED BY id-hmacWithSHA384} |
    {NULL IDENTIFIED BY id-hmacWithSHA512}, ... }

algid-hmacWithSHA1 AlgorithmIdentifier {{PBKDF2-PRFs}} ::=
    {algorithm id-hmacWithSHA1, parameters NULL : NULL}

id-hmacWithSHA1 OBJECT IDENTIFIER ::= {digestAlgorithm 7}

PBES2-Encs ALGORITHM-IDENTIFIER ::= { ... }

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class
public static class
public static class
public static class
public static class
public static class
public static class
public static class
public static class
public static class
public static class
public static class
public static class
public static class

Field Summary

Modifier and TypeField and Description
private static final ObjectIdentifier
private static final ObjectIdentifier
private static final ObjectIdentifier
private ObjectIdentifier
private AlgorithmParameterSpec
private int
private ObjectIdentifier
private int
private String
private static final ObjectIdentifier
private static final ObjectIdentifier
private byte[]

Constructor Summary

AccessConstructor and Description
pack-priv
pack-priv
PBES2Parameters(String pbes2AlgorithmName)

Method Summary

Modifier and TypeMethod and Description
protected byte[]
engineGetEncoded()

Implements abstract java.security.AlgorithmParametersSpi.engineGetEncoded.

Returns the parameters in their primary encoding format.

protected byte[]
engineGetEncoded(String encodingMethod)

Implements abstract java.security.AlgorithmParametersSpi.engineGetEncoded.

Returns the parameters encoded in the specified format.

protected <T extends AlgorithmParameterSpec> T
engineGetParameterSpec(Class<T> paramSpec)

Implements abstract java.security.AlgorithmParametersSpi.engineGetParameterSpec.

Returns a (transparent) specification of this parameters object.

protected void
engineInit(AlgorithmParameterSpec paramSpec)

Implements abstract java.security.AlgorithmParametersSpi.engineInit.

Initializes this parameters object using the parameters specified in paramSpec.

protected void
engineInit(byte[] encoded)

Implements abstract java.security.AlgorithmParametersSpi.engineInit.

Imports the specified parameters and decodes them according to the primary decoding format for parameters.

protected void
engineInit(byte[] encoded, String decodingMethod)

Implements abstract java.security.AlgorithmParametersSpi.engineInit.

Imports the parameters from params and decodes them according to the specified decoding format.

protected String
engineToString()

Implements abstract java.security.AlgorithmParametersSpi.engineToString.

Returns a formatted string describing the parameters.

private String
parseES(DerValue encryptionScheme)

Field Detail

aes128CBC_OIDback to summary
private static final ObjectIdentifier aes128CBC_OID
aes192CBC_OIDback to summary
private static final ObjectIdentifier aes192CBC_OID
aes256CBC_OIDback to summary
private static final ObjectIdentifier aes256CBC_OID
cipherAlgo_OIDback to summary
private ObjectIdentifier cipherAlgo_OID
cipherParamback to summary
private AlgorithmParameterSpec cipherParam
iCountback to summary
private int iCount
kdfAlgo_OIDback to summary
private ObjectIdentifier kdfAlgo_OID
keysizeback to summary
private int keysize
pbes2AlgorithmNameback to summary
private String pbes2AlgorithmName
pkcs5PBES2_OIDback to summary
private static final ObjectIdentifier pkcs5PBES2_OID
pkcs5PBKDF2_OIDback to summary
private static final ObjectIdentifier pkcs5PBKDF2_OID
saltback to summary
private byte[] salt

Constructor Detail

PBES2Parametersback to summary
pack-priv PBES2Parameters()
PBES2Parametersback to summary
pack-priv PBES2Parameters(String pbes2AlgorithmName) throws NoSuchAlgorithmException

Method Detail

engineGetEncodedback to summary
protected byte[] engineGetEncoded() throws IOException

Implements abstract java.security.AlgorithmParametersSpi.engineGetEncoded.

Doc from java.security.AlgorithmParametersSpi.engineGetEncoded.

Returns the parameters in their primary encoding format. The primary encoding format for parameters is ASN.1, if an ASN.1 specification for this type of parameters exists.

Exceptions
IOException:
on encoding errors.
engineGetEncodedback to summary
protected byte[] engineGetEncoded(String encodingMethod) throws IOException

Implements abstract java.security.AlgorithmParametersSpi.engineGetEncoded.

Doc from java.security.AlgorithmParametersSpi.engineGetEncoded.

Returns the parameters encoded in the specified format. If format is null, the primary encoding format for parameters is used. The primary encoding format is ASN.1, if an ASN.1 specification for these parameters exists.

Exceptions
IOException:
on encoding errors.
engineGetParameterSpecback to summary
protected <T extends AlgorithmParameterSpec> T engineGetParameterSpec(Class<T> paramSpec) throws InvalidParameterSpecException

Implements abstract java.security.AlgorithmParametersSpi.engineGetParameterSpec.

Doc from java.security.AlgorithmParametersSpi.engineGetParameterSpec.

Returns a (transparent) specification of this parameters object. paramSpec identifies the specification class in which the parameters should be returned. It could, for example, be DSAParameterSpec.class, to indicate that the parameters should be returned in an instance of the DSAParameterSpec class.

Exceptions
InvalidParameterSpecException:
if the requested parameter specification is inappropriate for this parameter object.
engineInitback to summary
protected void engineInit(AlgorithmParameterSpec paramSpec) throws InvalidParameterSpecException

Implements abstract java.security.AlgorithmParametersSpi.engineInit.

Doc from java.security.AlgorithmParametersSpi.engineInit.

Initializes this parameters object using the parameters specified in paramSpec.

Exceptions
InvalidParameterSpecException:
if the given parameter specification is inappropriate for the initialization of this parameter object.
engineInitback to summary
protected void engineInit(byte[] encoded) throws IOException

Implements abstract java.security.AlgorithmParametersSpi.engineInit.

Doc from java.security.AlgorithmParametersSpi.engineInit.

Imports the specified parameters and decodes them according to the primary decoding format for parameters. The primary decoding format for parameters is ASN.1, if an ASN.1 specification for this type of parameters exists.

Exceptions
IOException:
on decoding errors
engineInitback to summary
protected void engineInit(byte[] encoded, String decodingMethod) throws IOException

Implements abstract java.security.AlgorithmParametersSpi.engineInit.

Doc from java.security.AlgorithmParametersSpi.engineInit.

Imports the parameters from params and decodes them according to the specified decoding format. If format is null, the primary decoding format for parameters is used. The primary decoding format is ASN.1, if an ASN.1 specification for these parameters exists.

Exceptions
IOException:
on decoding errors
engineToStringback to summary
protected String engineToString()

Implements abstract java.security.AlgorithmParametersSpi.engineToString.

Doc from java.security.AlgorithmParametersSpi.engineToString.

Returns a formatted string describing the parameters.

parseESback to summary
private String parseES(DerValue encryptionScheme) throws IOException
com.sun.crypto.provider back to summary

public final Class PBES2Parameters.General

extends PBES2Parameters
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBES2Parameters:
engineGetEncodedengineGetEncodedengineGetParameterSpecengineInitengineInitengineInitengineToString

Constructor Detail

Generalback to summary
public General() throws NoSuchAlgorithmException
com.sun.crypto.provider back to summary

public final Class PBES2Parameters.HmacSHA1AndAES_128

extends PBES2Parameters
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBES2Parameters:
engineGetEncodedengineGetEncodedengineGetParameterSpecengineInitengineInitengineInitengineToString

Constructor Detail

HmacSHA1AndAES_128back to summary
public HmacSHA1AndAES_128() throws NoSuchAlgorithmException
com.sun.crypto.provider back to summary

public final Class PBES2Parameters.HmacSHA1AndAES_256

extends PBES2Parameters
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBES2Parameters:
engineGetEncodedengineGetEncodedengineGetParameterSpecengineInitengineInitengineInitengineToString

Constructor Detail

HmacSHA1AndAES_256back to summary
public HmacSHA1AndAES_256() throws NoSuchAlgorithmException
com.sun.crypto.provider back to summary

public final Class PBES2Parameters.HmacSHA224AndAES_128

extends PBES2Parameters
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBES2Parameters:
engineGetEncodedengineGetEncodedengineGetParameterSpecengineInitengineInitengineInitengineToString

Constructor Detail

HmacSHA224AndAES_128back to summary
public HmacSHA224AndAES_128() throws NoSuchAlgorithmException
com.sun.crypto.provider back to summary

public final Class PBES2Parameters.HmacSHA224AndAES_256

extends PBES2Parameters
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBES2Parameters:
engineGetEncodedengineGetEncodedengineGetParameterSpecengineInitengineInitengineInitengineToString

Constructor Detail

HmacSHA224AndAES_256back to summary
public HmacSHA224AndAES_256() throws NoSuchAlgorithmException
com.sun.crypto.provider back to summary

public final Class PBES2Parameters.HmacSHA256AndAES_128

extends PBES2Parameters
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBES2Parameters:
engineGetEncodedengineGetEncodedengineGetParameterSpecengineInitengineInitengineInitengineToString

Constructor Detail

HmacSHA256AndAES_128back to summary
public HmacSHA256AndAES_128() throws NoSuchAlgorithmException
com.sun.crypto.provider back to summary

public final Class PBES2Parameters.HmacSHA256AndAES_256

extends PBES2Parameters
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBES2Parameters:
engineGetEncodedengineGetEncodedengineGetParameterSpecengineInitengineInitengineInitengineToString

Constructor Detail

HmacSHA256AndAES_256back to summary
public HmacSHA256AndAES_256() throws NoSuchAlgorithmException
com.sun.crypto.provider back to summary

public final Class PBES2Parameters.HmacSHA384AndAES_128

extends PBES2Parameters
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBES2Parameters:
engineGetEncodedengineGetEncodedengineGetParameterSpecengineInitengineInitengineInitengineToString

Constructor Detail

HmacSHA384AndAES_128back to summary
public HmacSHA384AndAES_128() throws NoSuchAlgorithmException
com.sun.crypto.provider back to summary

public final Class PBES2Parameters.HmacSHA384AndAES_256

extends PBES2Parameters
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBES2Parameters:
engineGetEncodedengineGetEncodedengineGetParameterSpecengineInitengineInitengineInitengineToString

Constructor Detail

HmacSHA384AndAES_256back to summary
public HmacSHA384AndAES_256() throws NoSuchAlgorithmException
com.sun.crypto.provider back to summary

public final Class PBES2Parameters.HmacSHA512_224AndAES_128

extends PBES2Parameters
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBES2Parameters:
engineGetEncodedengineGetEncodedengineGetParameterSpecengineInitengineInitengineInitengineToString

Constructor Detail

HmacSHA512_224AndAES_128back to summary
public HmacSHA512_224AndAES_128() throws NoSuchAlgorithmException
com.sun.crypto.provider back to summary

public final Class PBES2Parameters.HmacSHA512_224AndAES_256

extends PBES2Parameters
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBES2Parameters:
engineGetEncodedengineGetEncodedengineGetParameterSpecengineInitengineInitengineInitengineToString

Constructor Detail

HmacSHA512_224AndAES_256back to summary
public HmacSHA512_224AndAES_256() throws NoSuchAlgorithmException
com.sun.crypto.provider back to summary

public final Class PBES2Parameters.HmacSHA512_256AndAES_128

extends PBES2Parameters
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBES2Parameters:
engineGetEncodedengineGetEncodedengineGetParameterSpecengineInitengineInitengineInitengineToString

Constructor Detail

HmacSHA512_256AndAES_128back to summary
public HmacSHA512_256AndAES_128() throws NoSuchAlgorithmException
com.sun.crypto.provider back to summary

public final Class PBES2Parameters.HmacSHA512_256AndAES_256

extends PBES2Parameters
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBES2Parameters:
engineGetEncodedengineGetEncodedengineGetParameterSpecengineInitengineInitengineInitengineToString

Constructor Detail

HmacSHA512_256AndAES_256back to summary
public HmacSHA512_256AndAES_256() throws NoSuchAlgorithmException
com.sun.crypto.provider back to summary

public final Class PBES2Parameters.HmacSHA512AndAES_128

extends PBES2Parameters
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBES2Parameters:
engineGetEncodedengineGetEncodedengineGetParameterSpecengineInitengineInitengineInitengineToString

Constructor Detail

HmacSHA512AndAES_128back to summary
public HmacSHA512AndAES_128() throws NoSuchAlgorithmException
com.sun.crypto.provider back to summary

public final Class PBES2Parameters.HmacSHA512AndAES_256

extends PBES2Parameters
Class Inheritance

Constructor Summary

AccessConstructor and Description
public

Method Summary

Inherited from com.sun.crypto.provider.PBES2Parameters:
engineGetEncodedengineGetEncodedengineGetParameterSpecengineInitengineInitengineInitengineToString

Constructor Detail

HmacSHA512AndAES_256back to summary
public HmacSHA512AndAES_256() throws NoSuchAlgorithmException