sun.security.mule.krb5
Class Checksum

java.lang.Object
  extended by sun.security.mule.krb5.Checksum

public class Checksum
extends Object

This class encapsulates the concept of a Kerberos checksum.


Field Summary
static int CKSUMTYPE_CRC32
           
static int CKSUMTYPE_DES_MAC
           
static int CKSUMTYPE_DES_MAC_K
           
static int CKSUMTYPE_HMAC_MD5_ARCFOUR
           
static int CKSUMTYPE_HMAC_SHA1_96_AES128
           
static int CKSUMTYPE_HMAC_SHA1_96_AES256
           
static int CKSUMTYPE_HMAC_SHA1_DES3_KD
           
static int CKSUMTYPE_NULL
           
static int CKSUMTYPE_RSA_MD4
           
static int CKSUMTYPE_RSA_MD4_DES
           
static int CKSUMTYPE_RSA_MD4_DES_K
           
static int CKSUMTYPE_RSA_MD5
           
static int CKSUMTYPE_RSA_MD5_DES
           
static int CKSUMTYPE_USE_DEFAULT
           
 
Constructor Summary
Checksum(byte[] data, int new_cksumType, Config kerberosConfig)
          Constructs a new Checksum using the raw data and type.
Checksum(int new_cksumType, byte[] data, Config kerberosConfig)
          Constructs a new Checksum by calculating the checksum over the data using specified checksum type.
Checksum(int new_cksumType, byte[] data, EncryptionKey key, int usage, Config kerberosConfig)
          Constructs a new Checksum by calculating the keyed checksum over the data using specified checksum type.
 
Method Summary
 byte[] asn1Encode()
          Encodes a Checksum object.
 boolean equals(Object obj)
           
 byte[] getBytes()
          Returns the raw bytes of the checksum, not in ASN.1 encoded form.
static int getChecksumdefault(Config kerberosConfig)
           
 int getType()
           
 int hashCode()
           
static Checksum parse(sun.security.util.DerInputStream data, byte explicitTag, boolean optional)
          Parse (unmarshal) a checksum object from a DER input stream.
 boolean verifyKeyedChecksum(byte[] data, EncryptionKey key, int usage)
          Verifies the keyed checksum over the data passed in.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CKSUMTYPE_NULL

public static final int CKSUMTYPE_NULL
See Also:
Constant Field Values

CKSUMTYPE_CRC32

public static final int CKSUMTYPE_CRC32
See Also:
Constant Field Values

CKSUMTYPE_RSA_MD4

public static final int CKSUMTYPE_RSA_MD4
See Also:
Constant Field Values

CKSUMTYPE_RSA_MD4_DES

public static final int CKSUMTYPE_RSA_MD4_DES
See Also:
Constant Field Values

CKSUMTYPE_DES_MAC

public static final int CKSUMTYPE_DES_MAC
See Also:
Constant Field Values

CKSUMTYPE_DES_MAC_K

public static final int CKSUMTYPE_DES_MAC_K
See Also:
Constant Field Values

CKSUMTYPE_RSA_MD4_DES_K

public static final int CKSUMTYPE_RSA_MD4_DES_K
See Also:
Constant Field Values

CKSUMTYPE_RSA_MD5

public static final int CKSUMTYPE_RSA_MD5
See Also:
Constant Field Values

CKSUMTYPE_RSA_MD5_DES

public static final int CKSUMTYPE_RSA_MD5_DES
See Also:
Constant Field Values

CKSUMTYPE_HMAC_SHA1_DES3_KD

public static final int CKSUMTYPE_HMAC_SHA1_DES3_KD
See Also:
Constant Field Values

CKSUMTYPE_HMAC_SHA1_96_AES128

public static final int CKSUMTYPE_HMAC_SHA1_96_AES128
See Also:
Constant Field Values

CKSUMTYPE_HMAC_SHA1_96_AES256

public static final int CKSUMTYPE_HMAC_SHA1_96_AES256
See Also:
Constant Field Values

CKSUMTYPE_HMAC_MD5_ARCFOUR

public static final int CKSUMTYPE_HMAC_MD5_ARCFOUR
See Also:
Constant Field Values

CKSUMTYPE_USE_DEFAULT

public static final int CKSUMTYPE_USE_DEFAULT
See Also:
Constant Field Values
Constructor Detail

Checksum

public Checksum(byte[] data,
                int new_cksumType,
                Config kerberosConfig)
Constructs a new Checksum using the raw data and type.


Checksum

public Checksum(int new_cksumType,
                byte[] data,
                Config kerberosConfig)
         throws KdcErrException,
                KrbCryptoException
Constructs a new Checksum by calculating the checksum over the data using specified checksum type.

Throws:
KdcErrException
KrbCryptoException

Checksum

public Checksum(int new_cksumType,
                byte[] data,
                EncryptionKey key,
                int usage,
                Config kerberosConfig)
         throws KdcErrException,
                KrbApErrException,
                KrbCryptoException
Constructs a new Checksum by calculating the keyed checksum over the data using specified checksum type.

Throws:
KdcErrException
KrbApErrException
KrbCryptoException
Method Detail

getChecksumdefault

public static int getChecksumdefault(Config kerberosConfig)

verifyKeyedChecksum

public boolean verifyKeyedChecksum(byte[] data,
                                   EncryptionKey key,
                                   int usage)
                            throws KdcErrException,
                                   KrbApErrException,
                                   KrbCryptoException
Verifies the keyed checksum over the data passed in.

Throws:
KdcErrException
KrbApErrException
KrbCryptoException

asn1Encode

public byte[] asn1Encode()
                  throws Asn1Exception,
                         IOException
Encodes a Checksum object. Checksum ::= SEQUENCE { cksumtype [0] Int32, checksum [1] OCTET STRING }

This definition reflects the Network Working Group RFC 4120 specification available at http://www.ietf.org/rfc/rfc4120.txt.

Returns:
byte array of enocded Checksum.
Throws:
Asn1Exception - if an error occurs while decoding an ASN1 encoded data.
IOException - if an I/O error occurs while reading encoded data.

parse

public static Checksum parse(sun.security.util.DerInputStream data,
                             byte explicitTag,
                             boolean optional)
                      throws Asn1Exception,
                             IOException
Parse (unmarshal) a checksum object from a DER input stream. This form parsing might be used when expanding a value which is part of a constructed sequence and uses explicitly tagged type.

Parameters:
data - the Der input stream value, which contains one or more marshaled value.
explicitTag - tag number.
optional - indicates if this data field is optional
Returns:
an instance of Checksum.
Throws:
Asn1Exception - if an error occurs while decoding an ASN1 encoded data.
IOException - if an I/O error occurs while reading encoded data.

getBytes

public final byte[] getBytes()
Returns the raw bytes of the checksum, not in ASN.1 encoded form.


getType

public final int getType()

equals

public boolean equals(Object obj)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2013. All Rights Reserved.