Most visited

Recently visited

Added in API level 1

DESedeKeySpec

public class DESedeKeySpec
extends Object implements KeySpec

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


该类指定了DES-EDE(“triple-DES”)密钥。

Summary

Constants

int DES_EDE_KEY_LEN

以字节为单位定义DESede密钥长度的常量。

Public constructors

DESedeKeySpec(byte[] key)

创建使用前24个字节在一个DESedeKeySpec对象, key作为DES-EDE密钥的密钥材料。

DESedeKeySpec(byte[] key, int offset)

创建使用前24个字节在一个DESedeKeySpec对象, key ,在开始 offset以下,作为DES-EDE密钥的密钥材料。

Public methods

byte[] getKey()

返回DES-EDE密钥。

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

检查从 offset开始的给定DES-EDE密钥是否是奇偶校验调整的。

Inherited methods

From class java.lang.Object

Constants

DES_EDE_KEY_LEN

Added in API level 1
int DES_EDE_KEY_LEN

以字节为单位定义DESede密钥长度的常量。

常量值:24(0x00000018)

Public constructors

DESedeKeySpec

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

创建使用前24个字节在一个DESedeKeySpec对象, key作为DES-EDE密钥的密钥材料。

构成DES-EDE密钥的字节是 key[0]key[23]之间的那些字节

Parameters
key byte: the buffer with the DES-EDE key material. The first 24 bytes of the buffer are copied to protect against subsequent modification.
Throws
NullPointerException if key is null.
InvalidKeyException if the given key material is shorter than 24 bytes.

DESedeKeySpec

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

创建使用前24个字节在一个DESedeKeySpec对象, key ,在开始 offset以下,作为DES-EDE密钥的密钥材料。

构成DES-EDE密钥的字节是 key[offset]key[offset+23]之间的 key[offset]

Parameters
key byte: 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.
Throws
NullPointerException if key is null.
InvalidKeyException if the given key material, starting at offset inclusive, is shorter than 24 bytes

Public methods

getKey

Added in API level 1
byte[] getKey ()

返回DES-EDE密钥。

Returns
byte[] the DES-EDE key. Returns a new array each time this method is called.

isParityAdjusted

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

检查从 offset开始的给定DES-EDE密钥是否是奇偶校验调整的。

Parameters
key byte: a byte array which holds the key value
offset int: the offset into the byte array
Returns
boolean true if the given DES-EDE key is parity-adjusted, false otherwise
Throws
NullPointerException if key is null.
InvalidKeyException if the given key material, starting at offset inclusive, is shorter than 24 bytes

Hooray!