Name
Class javax.crypto.spec.DESKeySpec
Description
This class represents a key that is used with a DES symmetric cipher.
This class is useful for converting between byte arrays and DES
SecretKey
s:
To convert from a byte array to a
SecretKey
, construct aDESKeySpec
from the byte array. Then useSecretKeyFactory
’sgenerateSecret()
to create theSecretKey
.To convert from a DES
SecretKey
to aDESKeySpec
, give theSecretKey
toSecretKeyFactory
’stranslateKey()
.
Class Definition
public class javax.crypto.spec.DESKeySpec extends java.lang.Object implements java.security.spec.KeySpec { // Constructors public DESKeySpec(byte[]); public DESKeySpec(byte[], int); // Class Methods public static boolean isParityAdjusted(byte[], int); public static boolean isWeak(byte[], int); // Instance Methods public byte[] getKey(); }
See Also
SecretKeyFactory
Get Java Cryptography now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.