Skip to content

Most visited

Recently visited

navigation
Added in API level 1

DESedeKeySpec

public class DESedeKeySpec
extends Object implements KeySpec

java.lang.Object
   ↳ javax.crypto.spec.DESedeKeySpec


The key specification for a triple-DES (DES-EDE) key.

Summary

Constants

int DES_EDE_KEY_LEN

The length of a DES-EDE key in bytes.

Public constructors

DESedeKeySpec(byte[] key)

Creates a new DESedeKeySpec instance from the first 24 ( DES_EDE_KEY_LEN) bytes of the specified key data.

DESedeKeySpec(byte[] key, int offset)

Creates a new DESedeKeySpec instance from the first 24 ( DES_EDE_KEY_LEN ) bytes of the specified key data starting at offset.

Public methods

byte[] getKey()

Returns a copy of the key.

static boolean isParityAdjusted(byte[] key, int offset)

Returns whether the specified key data starting at offset is parity-adjusted.

Inherited methods

From class java.lang.Object

Constants

DES_EDE_KEY_LEN

Added in API level 1
int DES_EDE_KEY_LEN

The length of a DES-EDE key in bytes.

Constant Value: 24 (0x00000018)

Public constructors

DESedeKeySpec

Added in API level 1
DESedeKeySpec (byte[] key)

Creates a new DESedeKeySpec instance from the first 24 ( DES_EDE_KEY_LEN) bytes of the specified key data.

Parameters
key byte: the key data.
Throws
InvalidKeyException if the length of the key data is less than 24.
NullPointerException if the key data is null.

DESedeKeySpec

Added in API level 1
DESedeKeySpec (byte[] key, 
                int offset)

Creates a new DESedeKeySpec instance from the first 24 ( DES_EDE_KEY_LEN ) bytes of the specified key data starting at offset.

Parameters
key byte: the key data
offset int: the offset to start at.
Throws
InvalidKeyException if the length of the key data starting at offset is less than 24.
NullPointerException if the key data is null.

Public methods

getKey

Added in API level 1
byte[] getKey ()

Returns a copy of the key.

Returns
byte[] a copy of the key.

isParityAdjusted

Added in API level 1
boolean isParityAdjusted (byte[] key, 
                int offset)

Returns whether the specified key data starting at offset is parity-adjusted.

Parameters
key byte: the key data.
offset int: the offset to start checking at.
Returns
boolean true if the specified key data is parity-adjusted, false otherwise.
Throws
InvalidKeyException if the length of the key data starting at offset is less than 24.
This site uses cookies to store your preferences for site-specific language and display options.

Hooray!

This class requires API level or higher

This doc is hidden because your selected API level for the documentation is . You can change the documentation API level with the selector above the left navigation.

For more information about specifying the API level your app requires, read Supporting Different Platform Versions.