Added in API level 1

DESedeKeySpec

open class DESedeKeySpec : KeySpec
kotlin.Any
   ↳ javax.crypto.spec.DESedeKeySpec

This class specifies a DES-EDE ("triple-DES") key.

Summary

Constants
static Int

The constant which defines the length of a DESede key in bytes.

Public constructors

Creates a DESedeKeySpec object using the first 24 bytes in key as the key material for the DES-EDE key.

DESedeKeySpec(key: ByteArray!, offset: Int)

Creates a DESedeKeySpec object using the first 24 bytes in key, beginning at offset inclusive, as the key material for the DES-EDE key.

Public methods
open ByteArray!

Returns the DES-EDE key.

open static Boolean
isParityAdjusted(key: ByteArray!, offset: Int)

Checks if the given DES-EDE key, starting at offset inclusive, is parity-adjusted.

Constants

DES_EDE_KEY_LEN

Added in API level 1
static val DES_EDE_KEY_LEN: Int

The constant which defines the length of a DESede key in bytes.

Value: 24

Public constructors

DESedeKeySpec

Added in API level 1
DESedeKeySpec(key: ByteArray!)

Creates a DESedeKeySpec object using the first 24 bytes in key as the key material for the DES-EDE key.

The bytes that constitute the DES-EDE key are those between key[0] and key[23] inclusive

Parameters
key ByteArray!: the buffer with the DES-EDE key material. The first 24 bytes of the buffer are copied to protect against subsequent modification.
Exceptions
java.lang.NullPointerException if key is null.
java.security.InvalidKeyException if the given key material is shorter than 24 bytes.

DESedeKeySpec

Added in API level 1
DESedeKeySpec(
    key: ByteArray!,
    offset: Int)

Creates a DESedeKeySpec object using the first 24 bytes in key, beginning at offset inclusive, as the key material for the DES-EDE key.

The bytes that constitute the DES-EDE key are those between key[offset] and key[offset+23] inclusive.

Parameters
key ByteArray!: the buffer with the DES-EDE key material. The first 24 bytes of the buffer beginning at offset inclusive are copied to protect against subsequent modification.
offset Int: the offset in key, where the DES-EDE key material starts.
Exceptions
java.lang.NullPointerException if key is null.
java.security.InvalidKeyException if the given key material, starting at offset inclusive, is shorter than 24 bytes

Public methods

getKey

Added in API level 1
open fun getKey(): ByteArray!

Returns the DES-EDE key.

Return
ByteArray! the DES-EDE key. Returns a new array each time this method is called.

isParityAdjusted

Added in API level 1
open static fun isParityAdjusted(
    key: ByteArray!,
    offset: Int
): Boolean

Checks if the given DES-EDE key, starting at offset inclusive, is parity-adjusted.

Parameters
key ByteArray!: a byte array which holds the key value
offset Int: the offset into the byte array
Return
Boolean true if the given DES-EDE key is parity-adjusted, false otherwise
Exceptions
java.lang.NullPointerException if key is null.
java.security.InvalidKeyException if the given key material, starting at offset inclusive, is shorter than 24 bytes