com.ibm.crypto.fips.provider

Class DESedeKey

  • java.lang.Object
    • com.ibm.crypto.fips.provider.DESedeKey
  • All Implemented Interfaces:
    java.io.Serializable, java.security.Key, javax.crypto.SecretKey, javax.security.auth.Destroyable


    public final class DESedeKey
    extends java.lang.Object
    implements javax.crypto.SecretKey
    This class represents a DES-EDE key.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor and Description
      DESedeKey(byte[] key)
      Creates a DES-EDE key from a given key.
      DESedeKey(byte[] key, int offset)
      Uses the first 24 bytes in key, beginning at offset, as the DES-EDE key
    • Method Summary

      Methods 
      Modifier and Type Method and Description
      boolean equals(java.lang.Object obj) 
      protected void finalize()
      This function zeroizes the key so that it isn't in memory when GC is done.
      java.lang.String getAlgorithm() 
      byte[] getEncoded() 
      java.lang.String getFormat() 
      int hashCode()
      Calculates a hash code value for the object.
      void zeroize()
      This function zeroizes the key so that it isn't in memory
      • Methods inherited from class java.lang.Object

        clone, getClass, notify, notifyAll, toString, wait, wait, wait
      • Methods inherited from interface javax.security.auth.Destroyable

        destroy, isDestroyed
    • Constructor Detail

      • DESedeKey

        public DESedeKey(byte[] key)
                  throws java.security.InvalidKeyException
        Creates a DES-EDE key from a given key.
        Parameters:
        key - the given key
        Throws:
        java.security.InvalidKeyException - if the given key has a wrong size
      • DESedeKey

        public DESedeKey(byte[] key,
                 int offset)
                  throws java.security.InvalidKeyException
        Uses the first 24 bytes in key, beginning at offset, as the DES-EDE key
        Parameters:
        key - the buffer with the DES-EDE key
        offset - the offset in key, where the DES-EDE key starts
        Throws:
        java.security.InvalidKeyException - if the given key has a wrong size
    • Method Detail

      • getEncoded

        public byte[] getEncoded()
        Specified by:
        getEncoded in interface java.security.Key
      • getAlgorithm

        public java.lang.String getAlgorithm()
        Specified by:
        getAlgorithm in interface java.security.Key
      • getFormat

        public java.lang.String getFormat()
        Specified by:
        getFormat in interface java.security.Key
      • hashCode

        public int hashCode()
        Calculates a hash code value for the object. Objects that are equal will also have the same hashcode.
        Overrides:
        hashCode in class java.lang.Object
      • equals

        public boolean equals(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • zeroize

        public void zeroize()
        This function zeroizes the key so that it isn't in memory
      • finalize

        protected void finalize()
        This function zeroizes the key so that it isn't in memory when GC is done.
        Overrides:
        finalize in class java.lang.Object
© Portions Copyright 2003, 2014, 2015, 2016 IBM Corporation. All rights reserved.
© Portions Copyright 2003, 2014 Oracle and/or its affiliates. All rights reserved.